<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*! asn1x509-1.0.13.js (c) 2013-2015 Kenji Urushima | kjur.github.com/jsrsasign/license
<span class='line'>  2</span>  */</span><span class="WHIT">
<span class='line'>  3</span> </span><span class="COMM">/*
<span class='line'>  4</span>  * asn1x509.js - ASN.1 DER encoder classes for X.509 certificate
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * Copyright (c) 2013-2015 Kenji Urushima (kenji.urushima@gmail.com)
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * This software is licensed under the terms of the MIT License.
<span class='line'>  9</span>  * http://kjur.github.com/jsrsasign/license
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * The above copyright and license notice shall be 
<span class='line'> 12</span>  * included in all copies or substantial portions of the Software.
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span>  * @fileOverview
<span class='line'> 17</span>  * @name asn1x509-1.0.js
<span class='line'> 18</span>  * @author Kenji Urushima kenji.urushima@gmail.com
<span class='line'> 19</span>  * @version 1.0.13 (2015-Oct-01)
<span class='line'> 20</span>  * @since jsrsasign 2.1
<span class='line'> 21</span>  * @license &lt;a href="http://kjur.github.io/jsrsasign/license/">MIT License&lt;/a>
<span class='line'> 22</span>  */</span><span class="WHIT">
<span class='line'> 23</span> 
<span class='line'> 24</span> </span><span class="COMM">/** 
<span class='line'> 25</span>  * kjur's class library name space
<span class='line'> 26</span>  * // already documented in asn1-1.0.js
<span class='line'> 27</span>  * @name KJUR
<span class='line'> 28</span>  * @namespace kjur's class library name space
<span class='line'> 29</span>  */</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="COMM">/**
<span class='line'> 33</span>  * kjur's ASN.1 class library name space
<span class='line'> 34</span>  * // already documented in asn1-1.0.js
<span class='line'> 35</span>  * @name KJUR.asn1
<span class='line'> 36</span>  * @namespace
<span class='line'> 37</span>  */</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR.asn1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> 
<span class='line'> 40</span> </span><span class="COMM">/**
<span class='line'> 41</span>  * kjur's ASN.1 class for X.509 certificate library name space
<span class='line'> 42</span>  * &lt;p>
<span class='line'> 43</span>  * &lt;h4>FEATURES&lt;/h4>
<span class='line'> 44</span>  * &lt;ul>
<span class='line'> 45</span>  * &lt;li>easily issue any kind of certificate&lt;/li>
<span class='line'> 46</span>  * &lt;li>APIs are very similar to BouncyCastle library ASN.1 classes. So easy to learn.&lt;/li>
<span class='line'> 47</span>  * &lt;/ul>
<span class='line'> 48</span>  * &lt;/p>
<span class='line'> 49</span>  * &lt;h4>PROVIDED CLASSES&lt;/h4>
<span class='line'> 50</span>  * &lt;ul>
<span class='line'> 51</span>  * &lt;li>{@link KJUR.asn1.x509.Certificate}&lt;/li>
<span class='line'> 52</span>  * &lt;li>{@link KJUR.asn1.x509.TBSCertificate}&lt;/li>
<span class='line'> 53</span>  * &lt;li>{@link KJUR.asn1.x509.Extension}&lt;/li>
<span class='line'> 54</span>  * &lt;li>{@link KJUR.asn1.x509.X500Name}&lt;/li>
<span class='line'> 55</span>  * &lt;li>{@link KJUR.asn1.x509.RDN}&lt;/li>
<span class='line'> 56</span>  * &lt;li>{@link KJUR.asn1.x509.AttributeTypeAndValue}&lt;/li>
<span class='line'> 57</span>  * &lt;li>{@link KJUR.asn1.x509.SubjectPublicKeyInfo}&lt;/li>
<span class='line'> 58</span>  * &lt;li>{@link KJUR.asn1.x509.AlgorithmIdentifier}&lt;/li>
<span class='line'> 59</span>  * &lt;li>{@link KJUR.asn1.x509.GeneralName}&lt;/li>
<span class='line'> 60</span>  * &lt;li>{@link KJUR.asn1.x509.GeneralNames}&lt;/li>
<span class='line'> 61</span>  * &lt;li>{@link KJUR.asn1.x509.DistributionPointName}&lt;/li>
<span class='line'> 62</span>  * &lt;li>{@link KJUR.asn1.x509.DistributionPoint}&lt;/li>
<span class='line'> 63</span>  * &lt;li>{@link KJUR.asn1.x509.CRL}&lt;/li>
<span class='line'> 64</span>  * &lt;li>{@link KJUR.asn1.x509.TBSCertList}&lt;/li>
<span class='line'> 65</span>  * &lt;li>{@link KJUR.asn1.x509.CRLEntry}&lt;/li>
<span class='line'> 66</span>  * &lt;li>{@link KJUR.asn1.x509.OID}&lt;/li>
<span class='line'> 67</span>  * &lt;/ul>
<span class='line'> 68</span>  * &lt;h4>SUPPORTED EXTENSIONS&lt;/h4>
<span class='line'> 69</span>  * &lt;ul>
<span class='line'> 70</span>  * &lt;li>{@link KJUR.asn1.x509.BasicConstraints}&lt;/li>
<span class='line'> 71</span>  * &lt;li>{@link KJUR.asn1.x509.KeyUsage}&lt;/li>
<span class='line'> 72</span>  * &lt;li>{@link KJUR.asn1.x509.CRLDistributionPoints}&lt;/li>
<span class='line'> 73</span>  * &lt;li>{@link KJUR.asn1.x509.ExtKeyUsage}&lt;/li>
<span class='line'> 74</span>  * &lt;li>{@link KJUR.asn1.x509.AuthorityKeyIdentifier}&lt;/li>
<span class='line'> 75</span>  * &lt;/ul>
<span class='line'> 76</span>  * NOTE: Please ignore method summary and document of this namespace. This caused by a bug of jsdoc2.
<span class='line'> 77</span>  * @name KJUR.asn1.x509
<span class='line'> 78</span>  * @namespace
<span class='line'> 79</span>  */</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR.asn1.x509</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> 
<span class='line'> 82</span> </span><span class="COMM">// === BEGIN Certificate ===================================================</span><span class="WHIT">
<span class='line'> 83</span> 
<span class='line'> 84</span> </span><span class="COMM">/**
<span class='line'> 85</span>  * X.509 Certificate class to sign and generate hex encoded certificate
<span class='line'> 86</span>  * @name KJUR.asn1.x509.Certificate
<span class='line'> 87</span>  * @class X.509 Certificate class to sign and generate hex encoded certificate
<span class='line'> 88</span>  * @param {Array} params associative array of parameters (ex. {'tbscertobj': obj, 'prvkeyobj': key})
<span class='line'> 89</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'> 90</span>  * @description
<span class='line'> 91</span>  * &lt;br/>
<span class='line'> 92</span>  * As for argument 'params' for constructor, you can specify one of
<span class='line'> 93</span>  * following properties:
<span class='line'> 94</span>  * &lt;ul>
<span class='line'> 95</span>  * &lt;li>tbscertobj - specify {@link KJUR.asn1.x509.TBSCertificate} object&lt;/li>
<span class='line'> 96</span>  * &lt;li>prvkeyobj - specify {@link RSAKey}, {@link KJUR.crypto.ECDSA} or {@link KJUR.crypto.DSA} object for CA private key to sign the certificate&lt;/li>
<span class='line'> 97</span>  * &lt;li>(DEPRECATED)rsaprvkey - specify {@link RSAKey} object CA private key&lt;/li>
<span class='line'> 98</span>  * &lt;li>(DEPRECATED)rsaprvpem - specify PEM string of RSA CA private key&lt;/li>
<span class='line'> 99</span>  * &lt;/ul>
<span class='line'>100</span>  * NOTE1: 'params' can be omitted.&lt;br/>
<span class='line'>101</span>  * NOTE2: DSA/ECDSA is also supported for CA signging key from asn1x509 1.0.6.
<span class='line'>102</span>  * @example
<span class='line'>103</span>  * var caKey = KEYUTIL.getKey(caKeyPEM); // CA's private key
<span class='line'>104</span>  * var cert = new KJUR.asn1x509.Certificate({'tbscertobj': tbs, 'prvkeyobj': caKey});
<span class='line'>105</span>  * cert.sign(); // issue certificate by CA's private key
<span class='line'>106</span>  * var certPEM = cert.getPEMString();
<span class='line'>107</span>  *
<span class='line'>108</span>  * // Certificate  ::=  SEQUENCE  {
<span class='line'>109</span>  * //     tbsCertificate       TBSCertificate,
<span class='line'>110</span>  * //     signatureAlgorithm   AlgorithmIdentifier,
<span class='line'>111</span>  * //     signature            BIT STRING  }        
<span class='line'>112</span>  */</span><span class="WHIT">
<span class='line'>113</span> </span><span class="NAME">KJUR.asn1.x509.Certificate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.Certificate.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1TBSCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hexSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaPrvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// DEPRECATED</span><span class="WHIT">
<span class='line'>121</span> 
<span class='line'>122</span> </span><span class="WHIT">    
<span class='line'>123</span>     </span><span class="COMM">/**
<span class='line'>124</span>      * set PKCS#5 encrypted RSA PEM private key as CA key
<span class='line'>125</span>      * @name setRsaPrvKeyByPEMandPass
<span class='line'>126</span>      * @memberOf KJUR.asn1.x509.Certificate
<span class='line'>127</span>      * @function
<span class='line'>128</span>      * @param {String} rsaPEM string of PKCS#5 encrypted RSA PEM private key
<span class='line'>129</span>      * @param {String} passPEM passcode string to decrypt private key
<span class='line'>130</span>      * @since 1.0.1
<span class='line'>131</span>      * @description
<span class='line'>132</span>      * &lt;br/>
<span class='line'>133</span>      * &lt;h4>EXAMPLES&lt;/h4>
<span class='line'>134</span>      * @example
<span class='line'>135</span>      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs});
<span class='line'>136</span>      * cert.setRsaPrvKeyByPEMandPass("-----BEGIN RSA PRIVATE..(snip)", "password");
<span class='line'>137</span>      */</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">    </span><span class="NAME">this.setRsaPrvKeyByPEMandPass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rsaPEM</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">passPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caKeyHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">PKCS5PKEY.getDecryptedKeyHex</span><span class="PUNC">(</span><span class="NAME">rsaPEM</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">passPEM</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RSAKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">        </span><span class="NAME">caKey.readPrivateKeyFromASN1HexString</span><span class="PUNC">(</span><span class="NAME">caKeyHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  
<span class='line'>142</span>         </span><span class="NAME">this.prvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>144</span> 
<span class='line'>145</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>146</span>      * sign TBSCertificate and set signature value internally
<span class='line'>147</span>      * @name sign
<span class='line'>148</span>      * @memberOf KJUR.asn1.x509.Certificate
<span class='line'>149</span>      * @function
<span class='line'>150</span>      * @description
<span class='line'>151</span>      * @example
<span class='line'>152</span>      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs, 'rsaprvkey': prvKey});
<span class='line'>153</span>      * cert.sign();
<span class='line'>154</span>      */</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">    </span><span class="NAME">this.sign</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.asn1TBSCert.asn1SignatureAlg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>157</span> 
<span class='line'>158</span> </span><span class="WHIT">        </span><span class="NAME">sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.Signature</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'alg'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'SHA1withRSA'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT">        </span><span class="NAME">sig.init</span><span class="PUNC">(</span><span class="NAME">this.prvKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT">        </span><span class="NAME">sig.updateHex</span><span class="PUNC">(</span><span class="NAME">this.asn1TBSCert.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT">        </span><span class="NAME">this.hexSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sig.sign</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> 
<span class='line'>163</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.hexSig</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT">        
<span class='line'>165</span>         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.asn1TBSCert</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1SignatureAlg</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1Sig</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT">        </span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>171</span> 
<span class='line'>172</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>173</span>      * set signature value internally by hex string
<span class='line'>174</span>      * @name setSignatureHex
<span class='line'>175</span>      * @memberOf KJUR.asn1.x509.Certificate
<span class='line'>176</span>      * @function
<span class='line'>177</span>      * @since asn1x509 1.0.8
<span class='line'>178</span>      * @description
<span class='line'>179</span>      * @example
<span class='line'>180</span>      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs});
<span class='line'>181</span>      * cert.setSignatureHex('01020304');
<span class='line'>182</span>      */</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT">    </span><span class="NAME">this.setSignatureHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sigHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.asn1TBSCert.asn1SignatureAlg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT">        </span><span class="NAME">this.hexSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sigHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.hexSig</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>187</span> 
<span class='line'>188</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.asn1TBSCert</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1SignatureAlg</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1Sig</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT">        </span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>194</span> 
<span class='line'>195</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not signed yet"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>199</span> 
<span class='line'>200</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>201</span>      * get PEM formatted certificate string after signed
<span class='line'>202</span>      * @name getPEMString
<span class='line'>203</span>      * @memberOf KJUR.asn1.x509.Certificate
<span class='line'>204</span>      * @function
<span class='line'>205</span>      * @return PEM formatted string of certificate
<span class='line'>206</span>      * @description
<span class='line'>207</span>      * @example
<span class='line'>208</span>      * var cert = new KJUR.asn1.x509.Certificate({'tbscertobj': tbs, 'rsaprvkey': prvKey});
<span class='line'>209</span>      * cert.sign();
<span class='line'>210</span>      * var sPEM =  cert.getPEMString();
<span class='line'>211</span>      */</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT">    </span><span class="NAME">this.getPEMString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">wCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Hex.parse</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">b64Cert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Base64.stringify</span><span class="PUNC">(</span><span class="NAME">wCert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pemBody</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b64Cert.replace</span><span class="PUNC">(</span><span class="REGX">/(.{64})/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"$1\r\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"-----BEGIN CERTIFICATE-----\r\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pemBody</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\r\n-----END CERTIFICATE-----\r\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> 
<span class='line'>220</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'tbscertobj'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1TBSCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'tbscertobj'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'prvkeyobj'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT">            </span><span class="NAME">this.prvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'prvkeyobj'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvkey'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT">            </span><span class="NAME">this.prvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvkey'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpem'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT">                   </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpas'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT">            </span><span class="NAME">this.setRsaPrvKeyByPEMandPass</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpem'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpas'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>233</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.Certificate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> 
<span class='line'>236</span> </span><span class="COMM">/**
<span class='line'>237</span>  * ASN.1 TBSCertificate structure class
<span class='line'>238</span>  * @name KJUR.asn1.x509.TBSCertificate
<span class='line'>239</span>  * @class ASN.1 TBSCertificate structure class
<span class='line'>240</span>  * @param {Array} params associative array of parameters (ex. {})
<span class='line'>241</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>242</span>  * @description
<span class='line'>243</span>  * &lt;br/>
<span class='line'>244</span>  * &lt;h4>EXAMPLE&lt;/h4>
<span class='line'>245</span>  * @example
<span class='line'>246</span>  *  var o = new KJUR.asn1.x509.TBSCertificate();
<span class='line'>247</span>  *  o.setSerialNumberByParam({'int': 4});
<span class='line'>248</span>  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
<span class='line'>249</span>  *  o.setIssuerByParam({'str': '/C=US/O=a'});
<span class='line'>250</span>  *  o.setNotBeforeByParam({'str': '130504235959Z'});
<span class='line'>251</span>  *  o.setNotAfterByParam({'str': '140504235959Z'});
<span class='line'>252</span>  *  o.setSubjectByParam({'str': '/C=US/CN=b'});
<span class='line'>253</span>  *  o.setSubjectPublicKeyByParam({'rsakey': rsaKey});
<span class='line'>254</span>  *  o.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true}));
<span class='line'>255</span>  *  o.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
<span class='line'>256</span>  */</span><span class="WHIT">
<span class='line'>257</span> </span><span class="NAME">KJUR.asn1.x509.TBSCertificate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.TBSCertificate.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>259</span> 
<span class='line'>260</span> </span><span class="WHIT">    </span><span class="NAME">this._initialize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> 
<span class='line'>263</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>264</span>             </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SerialNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Issuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NotBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NotAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Subject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT">        </span><span class="NAME">this.extensionsArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> 
<span class='line'>275</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>276</span>      * set serial number field by parameter
<span class='line'>277</span>      * @name setSerialNumberByParam
<span class='line'>278</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>279</span>      * @function
<span class='line'>280</span>      * @param {Array} intParam DERInteger param
<span class='line'>281</span>      * @description
<span class='line'>282</span>      * @example
<span class='line'>283</span>      * tbsc.setSerialNumberByParam({'int': 3});
<span class='line'>284</span>      */</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">    </span><span class="NAME">this.setSerialNumberByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">intParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SerialNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="NAME">intParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> 
<span class='line'>289</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>290</span>      * set signature algorithm field by parameter
<span class='line'>291</span>      * @name setSignatureAlgByParam
<span class='line'>292</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>293</span>      * @function
<span class='line'>294</span>      * @param {Array} algIdParam AlgorithmIdentifier parameter
<span class='line'>295</span>      * @description
<span class='line'>296</span>      * @example
<span class='line'>297</span>      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
<span class='line'>298</span>      */</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">    </span><span class="NAME">this.setSignatureAlgByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">algIdParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="NAME">algIdParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>302</span> 
<span class='line'>303</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>304</span>      * set issuer name field by parameter
<span class='line'>305</span>      * @name setIssuerByParam
<span class='line'>306</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>307</span>      * @function
<span class='line'>308</span>      * @param {Array} x500NameParam X500Name parameter
<span class='line'>309</span>      * @description
<span class='line'>310</span>      * @example
<span class='line'>311</span>      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
<span class='line'>312</span>      * @see KJUR.asn1.x509.X500Name
<span class='line'>313</span>      */</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">    </span><span class="NAME">this.setIssuerByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Issuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>317</span> 
<span class='line'>318</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>319</span>      * set notBefore field by parameter
<span class='line'>320</span>      * @name setNotBeforeByParam
<span class='line'>321</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>322</span>      * @function
<span class='line'>323</span>      * @param {Array} timeParam Time parameter
<span class='line'>324</span>      * @description
<span class='line'>325</span>      * @example
<span class='line'>326</span>      * tbsc.setNotBeforeByParam({'str': '130508235959Z'});
<span class='line'>327</span>      * @see KJUR.asn1.x509.Time
<span class='line'>328</span>      */</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT">    </span><span class="NAME">this.setNotBeforeByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NotBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT">    
<span class='line'>333</span>     </span><span class="COMM">/**
<span class='line'>334</span>      * set notAfter field by parameter
<span class='line'>335</span>      * @name setNotAfterByParam
<span class='line'>336</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>337</span>      * @function
<span class='line'>338</span>      * @param {Array} timeParam Time parameter
<span class='line'>339</span>      * @description
<span class='line'>340</span>      * @example
<span class='line'>341</span>      * tbsc.setNotAfterByParam({'str': '130508235959Z'});
<span class='line'>342</span>      * @see KJUR.asn1.x509.Time
<span class='line'>343</span>      */</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT">    </span><span class="NAME">this.setNotAfterByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NotAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> 
<span class='line'>348</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>349</span>      * set subject name field by parameter
<span class='line'>350</span>      * @name setSubjectByParam
<span class='line'>351</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>352</span>      * @function
<span class='line'>353</span>      * @param {Array} x500NameParam X500Name parameter
<span class='line'>354</span>      * @description
<span class='line'>355</span>      * @example
<span class='line'>356</span>      * tbsc.setSubjectParam({'str': '/C=US/CN=b'});
<span class='line'>357</span>      * @see KJUR.asn1.x509.X500Name
<span class='line'>358</span>      */</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT">    </span><span class="NAME">this.setSubjectByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Subject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>362</span> 
<span class='line'>363</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>364</span>      * (DEPRECATED) set subject public key info field by RSA key parameter
<span class='line'>365</span>      * @name setSubjectPublicKeyByParam
<span class='line'>366</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>367</span>      * @function
<span class='line'>368</span>      * @param {Array} subjPKeyParam SubjectPublicKeyInfo parameter of RSA
<span class='line'>369</span>      * @deprecated
<span class='line'>370</span>      * @description
<span class='line'>371</span>      * @example
<span class='line'>372</span>      * tbsc.setSubjectPublicKeyByParam({'rsakey': pubKey});
<span class='line'>373</span>      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
<span class='line'>374</span>      */</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">    </span><span class="NAME">this.setSubjectPublicKeyByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">subjPKeyParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.SubjectPublicKeyInfo</span><span class="PUNC">(</span><span class="NAME">subjPKeyParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> 
<span class='line'>379</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>380</span>      * set subject public key info by RSA/ECDSA/DSA key parameter
<span class='line'>381</span>      * @name setSubjectPublicKeyByGetKey
<span class='line'>382</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>383</span>      * @function
<span class='line'>384</span>      * @param {Object} keyParam public key parameter which passed to {@link KEYUTIL.getKey} argument
<span class='line'>385</span>      * @description
<span class='line'>386</span>      * @example
<span class='line'>387</span>      * tbsc.setSubjectPublicKeyByGetKeyParam(certPEMString); // or 
<span class='line'>388</span>      * tbsc.setSubjectPublicKeyByGetKeyParam(pkcs8PublicKeyPEMString); // or 
<span class='line'>389</span>      * tbsc.setSubjectPublicKeyByGetKeyParam(kjurCryptoECDSAKeyObject); // et.al.
<span class='line'>390</span>      * @see KJUR.asn1.x509.SubjectPublicKeyInfo
<span class='line'>391</span>      * @see KEYUTIL.getKey
<span class='line'>392</span>      * @since asn1x509 1.0.6
<span class='line'>393</span>      */</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">    </span><span class="NAME">this.setSubjectPublicKeyByGetKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">keyParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KEYUTIL.getKey</span><span class="PUNC">(</span><span class="NAME">keyParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.SubjectPublicKeyInfo</span><span class="PUNC">(</span><span class="NAME">keyObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> 
<span class='line'>399</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>400</span>      * append X.509v3 extension to this object
<span class='line'>401</span>      * @name appendExtension
<span class='line'>402</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>403</span>      * @function
<span class='line'>404</span>      * @param {Extension} extObj X.509v3 Extension object
<span class='line'>405</span>      * @description
<span class='line'>406</span>      * @example
<span class='line'>407</span>      * tbsc.appendExtension(new KJUR.asn1.x509.BasicConstraints({'cA':true, 'critical': true}));
<span class='line'>408</span>      * tbsc.appendExtension(new KJUR.asn1.x509.KeyUsage({'bin':'11'}));
<span class='line'>409</span>      * @see KJUR.asn1.x509.Extension
<span class='line'>410</span>      */</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">    </span><span class="NAME">this.appendExtension</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">        </span><span class="NAME">this.extensionsArray.push</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>414</span> 
<span class='line'>415</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>416</span>      * append X.509v3 extension to this object by name and parameters
<span class='line'>417</span>      * @name appendExtensionByName
<span class='line'>418</span>      * @memberOf KJUR.asn1.x509.TBSCertificate
<span class='line'>419</span>      * @function
<span class='line'>420</span>      * @param {name} name name of X.509v3 Extension object
<span class='line'>421</span>      * @param {Array} extParams parameters as argument of Extension constructor.
<span class='line'>422</span>      * @description
<span class='line'>423</span>      * @example
<span class='line'>424</span>      * tbsc.appendExtensionByName('BasicConstraints', {'cA':true, 'critical': true});
<span class='line'>425</span>      * tbsc.appendExtensionByName('KeyUsage', {'bin':'11'});
<span class='line'>426</span>      * tbsc.appendExtensionByName('CRLDistributionPoints', {uri: 'http://aaa.com/a.crl'});
<span class='line'>427</span>      * tbsc.appendExtensionByName('ExtKeyUsage', {array: [{name: 'clientAuth'}]});
<span class='line'>428</span>      * tbsc.appendExtensionByName('AuthorityKeyIdentifier', {kid: '1234ab..'});
<span class='line'>429</span>      * @see KJUR.asn1.x509.Extension
<span class='line'>430</span>      */</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">    </span><span class="NAME">this.appendExtensionByName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"basicconstraints"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.BasicConstraints</span><span class="PUNC">(</span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT">            </span><span class="NAME">this.appendExtension</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"keyusage"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.KeyUsage</span><span class="PUNC">(</span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">            </span><span class="NAME">this.appendExtension</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"crldistributionpoints"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.CRLDistributionPoints</span><span class="PUNC">(</span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT">            </span><span class="NAME">this.appendExtension</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"extkeyusage"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.ExtKeyUsage</span><span class="PUNC">(</span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">            </span><span class="NAME">this.appendExtension</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">name.toLowerCase</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"authoritykeyidentifier"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AuthorityKeyIdentifier</span><span class="PUNC">(</span><span class="NAME">extParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">            </span><span class="NAME">this.appendExtension</span><span class="PUNC">(</span><span class="NAME">extObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"unsupported extension name: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>451</span> 
<span class='line'>452</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1NotBefore</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.asn1NotAfter</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"notBefore and/or notAfter not set"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Validity</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>456</span>             </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="PUNC">[</span><span class="NAME">this.asn1NotBefore</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.asn1NotAfter</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>457</span> 
<span class='line'>458</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> 
<span class='line'>460</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Version</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1SerialNumber</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1SignatureAlg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Issuer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">asn1Validity</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Subject</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1SubjPKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>467</span> 
<span class='line'>468</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.extensionsArray.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extSeq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.extensionsArray</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extTagObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">                                                           </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'a3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">                                                           </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">extSeq</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">extTagObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>475</span> 
<span class='line'>476</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">        </span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>481</span> 
<span class='line'>482</span> </span><span class="WHIT">    </span><span class="NAME">this._initialize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>483</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>484</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.TBSCertificate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>485</span> 
<span class='line'>486</span> </span><span class="COMM">// === END   TBSCertificate ===================================================</span><span class="WHIT">
<span class='line'>487</span> 
<span class='line'>488</span> </span><span class="COMM">// === BEGIN X.509v3 Extensions Related =======================================</span><span class="WHIT">
<span class='line'>489</span> 
<span class='line'>490</span> </span><span class="COMM">/**
<span class='line'>491</span>  * base Extension ASN.1 structure class
<span class='line'>492</span>  * @name KJUR.asn1.x509.Extension
<span class='line'>493</span>  * @class base Extension ASN.1 structure class
<span class='line'>494</span>  * @param {Array} params associative array of parameters (ex. {'critical': true})
<span class='line'>495</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>496</span>  * @description
<span class='line'>497</span>  * @example
<span class='line'>498</span>  * // Extension  ::=  SEQUENCE  {
<span class='line'>499</span>  * //     extnID      OBJECT IDENTIFIER,
<span class='line'>500</span>  * //     critical    BOOLEAN DEFAULT FALSE,
<span class='line'>501</span>  * //     extnValue   OCTET STRING  }
<span class='line'>502</span>  */</span><span class="WHIT">
<span class='line'>503</span> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.Extension.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>506</span> 
<span class='line'>507</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERObjectIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'oid'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.oid</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>509</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1EncapExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>510</span>             </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DEROctetString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getExtnValueHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> 
<span class='line'>512</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">        </span><span class="NAME">asn1Array.push</span><span class="PUNC">(</span><span class="NAME">asn1Oid</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.critical</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">asn1Array.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBoolean</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">        </span><span class="NAME">asn1Array.push</span><span class="PUNC">(</span><span class="NAME">asn1EncapExtnValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> 
<span class='line'>517</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">asn1Seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> 
<span class='line'>521</span> </span><span class="WHIT">    </span><span class="NAME">this.critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'critical'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT">            </span><span class="NAME">this.critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'critical'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>527</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>528</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>529</span> 
<span class='line'>530</span> </span><span class="COMM">/**
<span class='line'>531</span>  * KeyUsage ASN.1 structure class
<span class='line'>532</span>  * @name KJUR.asn1.x509.KeyUsage
<span class='line'>533</span>  * @class KeyUsage ASN.1 structure class
<span class='line'>534</span>  * @param {Array} params associative array of parameters (ex. {'bin': '11', 'critical': true})
<span class='line'>535</span>  * @extends KJUR.asn1.x509.Extension
<span class='line'>536</span>  * @description
<span class='line'>537</span>  * @example
<span class='line'>538</span>  */</span><span class="WHIT">
<span class='line'>539</span> </span><span class="NAME">KJUR.asn1.x509.KeyUsage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.KeyUsage.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> 
<span class='line'>542</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1ExtnValue.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> 
<span class='line'>546</span> </span><span class="WHIT">    </span><span class="NAME">this.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2.5.29.15"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'bin'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>552</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>553</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.KeyUsage</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>554</span> 
<span class='line'>555</span> </span><span class="COMM">/**
<span class='line'>556</span>  * BasicConstraints ASN.1 structure class
<span class='line'>557</span>  * @name KJUR.asn1.x509.BasicConstraints
<span class='line'>558</span>  * @class BasicConstraints ASN.1 structure class
<span class='line'>559</span>  * @param {Array} params associative array of parameters (ex. {'cA': true, 'critical': true})
<span class='line'>560</span>  * @extends KJUR.asn1.x509.Extension
<span class='line'>561</span>  * @description
<span class='line'>562</span>  * @example
<span class='line'>563</span>  */</span><span class="WHIT">
<span class='line'>564</span> </span><span class="NAME">KJUR.asn1.x509.BasicConstraints</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>565</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.BasicConstraints.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>566</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cA</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>567</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pathLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>568</span> 
<span class='line'>569</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>570</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>571</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.cA</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">asn1Array.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBoolean</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.pathLen</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> 
<span class='line'>573</span>             </span><span class="NAME">asn1Array.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.pathLen</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">asn1Seq</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1ExtnValue.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>577</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>578</span> 
<span class='line'>579</span> </span><span class="WHIT">    </span><span class="NAME">this.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2.5.29.19"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>580</span> </span><span class="WHIT">    </span><span class="NAME">this.cA</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>581</span> </span><span class="WHIT">    </span><span class="NAME">this.pathLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>582</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>583</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'cA'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>584</span> </span><span class="WHIT">            </span><span class="NAME">this.cA</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'cA'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>585</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>586</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'pathLen'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>587</span> </span><span class="WHIT">            </span><span class="NAME">this.pathLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'pathLen'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>588</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>589</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>590</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>591</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.BasicConstraints</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>592</span> 
<span class='line'>593</span> </span><span class="COMM">/**
<span class='line'>594</span>  * CRLDistributionPoints ASN.1 structure class
<span class='line'>595</span>  * @name KJUR.asn1.x509.CRLDistributionPoints
<span class='line'>596</span>  * @class CRLDistributionPoints ASN.1 structure class
<span class='line'>597</span>  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
<span class='line'>598</span>  * @extends KJUR.asn1.x509.Extension
<span class='line'>599</span>  * @description
<span class='line'>600</span>  * @example
<span class='line'>601</span>  */</span><span class="WHIT">
<span class='line'>602</span> </span><span class="NAME">KJUR.asn1.x509.CRLDistributionPoints</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>603</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.CRLDistributionPoints.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>604</span> 
<span class='line'>605</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>606</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1ExtnValue.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>607</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>608</span> 
<span class='line'>609</span> </span><span class="WHIT">    </span><span class="NAME">this.setByDPArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dpArray</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>610</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dpArray</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>612</span> 
<span class='line'>613</span> </span><span class="WHIT">    </span><span class="NAME">this.setByOneURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">uri</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">gn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.GeneralNames</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">{</span><span class="STRN">'uri'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">uri</span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dpn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.DistributionPointName</span><span class="PUNC">(</span><span class="NAME">gn1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dp1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.DistributionPoint</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'dpobj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">dpn1</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">        </span><span class="NAME">this.setByDPArray</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">dp1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>619</span> 
<span class='line'>620</span> </span><span class="WHIT">    </span><span class="NAME">this.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2.5.29.31"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>622</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'array'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>623</span> </span><span class="WHIT">            </span><span class="NAME">this.setByDPArray</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'array'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'uri'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">            </span><span class="NAME">this.setByOneURI</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'uri'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>628</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>629</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.CRLDistributionPoints</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>630</span> 
<span class='line'>631</span> </span><span class="COMM">/**
<span class='line'>632</span>  * KeyUsage ASN.1 structure class
<span class='line'>633</span>  * @name KJUR.asn1.x509.ExtKeyUsage
<span class='line'>634</span>  * @class ExtKeyUsage ASN.1 structure class
<span class='line'>635</span>  * @param {Array} params associative array of parameters
<span class='line'>636</span>  * @extends KJUR.asn1.x509.Extension
<span class='line'>637</span>  * @description
<span class='line'>638</span>  * @example
<span class='line'>639</span>  * var e1 = 
<span class='line'>640</span>  *     new KJUR.asn1.x509.ExtKeyUsage({'critical': true,
<span class='line'>641</span>  *                                     'array':
<span class='line'>642</span>  *                                     [{'oid': '2.5.29.37.0',  // anyExtendedKeyUsage
<span class='line'>643</span>  *                                       'name': 'clientAuth'}]});
<span class='line'>644</span>  *
<span class='line'>645</span>  * // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }
<span class='line'>646</span>  * // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
<span class='line'>647</span>  * // KeyPurposeId ::= OBJECT IDENTIFIER
<span class='line'>648</span>  */</span><span class="WHIT">
<span class='line'>649</span> </span><span class="NAME">KJUR.asn1.x509.ExtKeyUsage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>650</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.ExtKeyUsage.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>651</span> 
<span class='line'>652</span> </span><span class="WHIT">    </span><span class="NAME">this.setPurposeArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">purposeArray</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>653</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>654</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">purposeArray.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>655</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERObjectIdentifier</span><span class="PUNC">(</span><span class="NAME">purposeArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>656</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1ExtnValue.appendASN1Object</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>658</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>659</span> 
<span class='line'>660</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>661</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1ExtnValue.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>663</span> 
<span class='line'>664</span> </span><span class="WHIT">    </span><span class="NAME">this.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2.5.29.37"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>665</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>666</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'array'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT">            </span><span class="NAME">this.setPurposeArray</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'array'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>670</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>671</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.ExtKeyUsage</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>672</span> 
<span class='line'>673</span> </span><span class="COMM">/**
<span class='line'>674</span>  * AuthorityKeyIdentifier ASN.1 structure class
<span class='line'>675</span>  * @name KJUR.asn1.x509.AuthorityKeyIdentifier
<span class='line'>676</span>  * @class AuthorityKeyIdentifier ASN.1 structure class
<span class='line'>677</span>  * @param {Array} params associative array of parameters (ex. {'uri': 'http://a.com/', 'critical': true})
<span class='line'>678</span>  * @extends KJUR.asn1.x509.Extension
<span class='line'>679</span>  * @since asn1x509 1.0.8
<span class='line'>680</span>  * @description
<span class='line'>681</span>  * &lt;pre>
<span class='line'>682</span>  * d-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 }
<span class='line'>683</span>  * AuthorityKeyIdentifier ::= SEQUENCE {
<span class='line'>684</span>  *    keyIdentifier             [0] KeyIdentifier           OPTIONAL,
<span class='line'>685</span>  *    authorityCertIssuer       [1] GeneralNames            OPTIONAL,
<span class='line'>686</span>  *    authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL  }
<span class='line'>687</span>  * KeyIdentifier ::= OCTET STRING
<span class='line'>688</span>  * &lt;/pre>
<span class='line'>689</span>  * @example
<span class='line'>690</span>  * var param = {'kid': {'hex': '89ab'},
<span class='line'>691</span>  *              'issuer': {'str': '/C=US/CN=a'},
<span class='line'>692</span>  *              'sn': {'hex': '1234'},
<span class='line'>693</span>  *              'critical': true});
<span class='line'>694</span>  * var e1 = new KJUR.asn1.x509.AuthorityKeyIdentifier(param);
<span class='line'>695</span>  */</span><span class="WHIT">
<span class='line'>696</span> </span><span class="NAME">KJUR.asn1.x509.AuthorityKeyIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>697</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>698</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1KID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1CertIssuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1CertSN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>701</span> 
<span class='line'>702</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1KID</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>705</span> </span><span class="WHIT">            </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>706</span> </span><span class="WHIT">                                                  </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'80'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">                                                  </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1KID</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1CertIssuer</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">            </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">                                                  </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'a1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">                                                  </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1CertIssuer</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>712</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1CertSN</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">            </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">                                                  </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'82'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>715</span> </span><span class="WHIT">                                                  </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1CertSN</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>716</span> 
<span class='line'>717</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>718</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ExtnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">asn1Seq</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>719</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1ExtnValue.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>720</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>721</span> 
<span class='line'>722</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>723</span>      * set keyIdentifier value by DERInteger parameter
<span class='line'>724</span>      * @name setKIDByParam
<span class='line'>725</span>      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier
<span class='line'>726</span>      * @function
<span class='line'>727</span>      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
<span class='line'>728</span>      * @since asn1x509 1.0.8
<span class='line'>729</span>      * @description
<span class='line'>730</span>      * NOTE: Automatic keyIdentifier value calculation by an issuer 
<span class='line'>731</span>      * public key will be supported in future version.
<span class='line'>732</span>      */</span><span class="WHIT">
<span class='line'>733</span> </span><span class="WHIT">    </span><span class="NAME">this.setKIDByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1KID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DEROctetString</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>736</span> 
<span class='line'>737</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>738</span>      * set authorityCertIssuer value by X500Name parameter
<span class='line'>739</span>      * @name setCertIssuerByParam
<span class='line'>740</span>      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier
<span class='line'>741</span>      * @function
<span class='line'>742</span>      * @param {Array} param array of {@link KJUR.asn1.x509.X500Name} parameter
<span class='line'>743</span>      * @since asn1x509 1.0.8
<span class='line'>744</span>      * @description
<span class='line'>745</span>      * NOTE: Automatic authorityCertIssuer name setting by an issuer 
<span class='line'>746</span>      * certificate will be supported in future version.
<span class='line'>747</span>      */</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">    </span><span class="NAME">this.setCertIssuerByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1CertIssuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>751</span> 
<span class='line'>752</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>753</span>      * set authorityCertSerialNumber value by DERInteger parameter
<span class='line'>754</span>      * @name setCertSerialNumberByParam
<span class='line'>755</span>      * @memberOf KJUR.asn1.x509.AuthorityKeyIdentifier
<span class='line'>756</span>      * @function
<span class='line'>757</span>      * @param {Array} param array of {@link KJUR.asn1.DERInteger} parameter
<span class='line'>758</span>      * @since asn1x509 1.0.8
<span class='line'>759</span>      * @description
<span class='line'>760</span>      * NOTE: Automatic authorityCertSerialNumber setting by an issuer 
<span class='line'>761</span>      * certificate will be supported in future version.
<span class='line'>762</span>      */</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">    </span><span class="NAME">this.setCertSNByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1CertSN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>766</span> 
<span class='line'>767</span> </span><span class="WHIT">    </span><span class="NAME">this.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2.5.29.35"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>768</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'kid'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT">            </span><span class="NAME">this.setKIDByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'kid'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'issuer'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT">            </span><span class="NAME">this.setCertIssuerByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'issuer'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'sn'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>776</span> </span><span class="WHIT">            </span><span class="NAME">this.setCertSNByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'sn'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>779</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>780</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.AuthorityKeyIdentifier</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Extension</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>781</span> 
<span class='line'>782</span> </span><span class="COMM">// === END   X.509v3 Extensions Related =======================================</span><span class="WHIT">
<span class='line'>783</span> 
<span class='line'>784</span> </span><span class="COMM">// === BEGIN CRL Related ===================================================</span><span class="WHIT">
<span class='line'>785</span> </span><span class="COMM">/**
<span class='line'>786</span>  * X.509 CRL class to sign and generate hex encoded CRL
<span class='line'>787</span>  * @name KJUR.asn1.x509.CRL
<span class='line'>788</span>  * @class X.509 CRL class to sign and generate hex encoded certificate
<span class='line'>789</span>  * @param {Array} params associative array of parameters (ex. {'tbsobj': obj, 'rsaprvkey': key})
<span class='line'>790</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>791</span>  * @since 1.0.3
<span class='line'>792</span>  * @description
<span class='line'>793</span>  * &lt;br/>
<span class='line'>794</span>  * As for argument 'params' for constructor, you can specify one of
<span class='line'>795</span>  * following properties:
<span class='line'>796</span>  * &lt;ul>
<span class='line'>797</span>  * &lt;li>tbsobj - specify {@link KJUR.asn1.x509.TBSCertList} object to be signed&lt;/li>
<span class='line'>798</span>  * &lt;li>rsaprvkey - specify {@link RSAKey} object CA private key&lt;/li>
<span class='line'>799</span>  * &lt;/ul>
<span class='line'>800</span>  * NOTE: 'params' can be omitted.
<span class='line'>801</span>  * &lt;h4>EXAMPLE&lt;/h4>
<span class='line'>802</span>  * @example
<span class='line'>803</span>  * var prvKey = new RSAKey(); // CA's private key
<span class='line'>804</span>  * prvKey.readPrivateKeyFromASN1HexString("3080...");
<span class='line'>805</span>  * var crl = new KJUR.asn1x509.CRL({'tbsobj': tbs, 'rsaprvkey': prvKey});
<span class='line'>806</span>  * crl.sign(); // issue CRL by CA's private key
<span class='line'>807</span>  * var hCRL = crl.getEncodedHex();
<span class='line'>808</span>  *
<span class='line'>809</span>  * // CertificateList  ::=  SEQUENCE  {
<span class='line'>810</span>  * //     tbsCertList          TBSCertList,
<span class='line'>811</span>  * //     signatureAlgorithm   AlgorithmIdentifier,
<span class='line'>812</span>  * //     signatureValue       BIT STRING  }
<span class='line'>813</span>  */</span><span class="WHIT">
<span class='line'>814</span> </span><span class="NAME">KJUR.asn1.x509.CRL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>815</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.CRL.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>816</span> 
<span class='line'>817</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1TBSCertList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>818</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>819</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>820</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hexSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>821</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaPrvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>822</span> </span><span class="WHIT">    
<span class='line'>823</span>     </span><span class="COMM">/**
<span class='line'>824</span>      * set PKCS#5 encrypted RSA PEM private key as CA key
<span class='line'>825</span>      * @name setRsaPrvKeyByPEMandPass
<span class='line'>826</span>      * @memberOf KJUR.asn1.x509.CRL
<span class='line'>827</span>      * @function
<span class='line'>828</span>      * @param {String} rsaPEM string of PKCS#5 encrypted RSA PEM private key
<span class='line'>829</span>      * @param {String} passPEM passcode string to decrypt private key
<span class='line'>830</span>      * @description
<span class='line'>831</span>      * &lt;br/>
<span class='line'>832</span>      * &lt;h4>EXAMPLES&lt;/h4>
<span class='line'>833</span>      * @example
<span class='line'>834</span>      */</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">    </span><span class="NAME">this.setRsaPrvKeyByPEMandPass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rsaPEM</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">passPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caKeyHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">PKCS5PKEY.getDecryptedKeyHex</span><span class="PUNC">(</span><span class="NAME">rsaPEM</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">passPEM</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RSAKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">        </span><span class="NAME">caKey.readPrivateKeyFromASN1HexString</span><span class="PUNC">(</span><span class="NAME">caKeyHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  
<span class='line'>839</span>         </span><span class="NAME">this.rsaPrvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>841</span> 
<span class='line'>842</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>843</span>      * sign TBSCertList and set signature value internally
<span class='line'>844</span>      * @name sign
<span class='line'>845</span>      * @memberOf KJUR.asn1.x509.CRL
<span class='line'>846</span>      * @function
<span class='line'>847</span>      * @description
<span class='line'>848</span>      * @example
<span class='line'>849</span>      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'rsaprvkey': prvKey});
<span class='line'>850</span>      * cert.sign();
<span class='line'>851</span>      */</span><span class="WHIT">
<span class='line'>852</span> </span><span class="WHIT">    </span><span class="NAME">this.sign</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>853</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.asn1TBSCertList.asn1SignatureAlg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>854</span> 
<span class='line'>855</span> </span><span class="WHIT">        </span><span class="NAME">sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.Signature</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'alg'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'SHA1withRSA'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'prov'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'cryptojs/jsrsa'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">        </span><span class="NAME">sig.initSign</span><span class="PUNC">(</span><span class="NAME">this.rsaPrvKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>857</span> </span><span class="WHIT">        </span><span class="NAME">sig.updateHex</span><span class="PUNC">(</span><span class="NAME">this.asn1TBSCertList.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>858</span> </span><span class="WHIT">        </span><span class="NAME">this.hexSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sig.sign</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>859</span> 
<span class='line'>860</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.hexSig</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>861</span> </span><span class="WHIT">        
<span class='line'>862</span>         </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.asn1TBSCertList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>863</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1SignatureAlg</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">                                                       </span><span class="NAME">this.asn1Sig</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>865</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>866</span> </span><span class="WHIT">        </span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>867</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>868</span> 
<span class='line'>869</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>870</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>871</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not signed yet"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>873</span> 
<span class='line'>874</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>875</span>      * get PEM formatted CRL string after signed
<span class='line'>876</span>      * @name getPEMString
<span class='line'>877</span>      * @memberOf KJUR.asn1.x509.CRL
<span class='line'>878</span>      * @function
<span class='line'>879</span>      * @return PEM formatted string of certificate
<span class='line'>880</span>      * @description
<span class='line'>881</span>      * @example
<span class='line'>882</span>      * var cert = new KJUR.asn1.x509.CRL({'tbsobj': tbs, 'rsaprvkey': prvKey});
<span class='line'>883</span>      * cert.sign();
<span class='line'>884</span>      * var sPEM =  cert.getPEMString();
<span class='line'>885</span>      */</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">    </span><span class="NAME">this.getPEMString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>887</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>888</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">wCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Hex.parse</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">b64Cert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Base64.stringify</span><span class="PUNC">(</span><span class="NAME">wCert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pemBody</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b64Cert.replace</span><span class="PUNC">(</span><span class="REGX">/(.{64})/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"$1\r\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"-----BEGIN X509 CRL-----\r\n"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pemBody</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\r\n-----END X509 CRL-----\r\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>892</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>893</span> 
<span class='line'>894</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>895</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'tbsobj'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1TBSCertList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'tbsobj'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvkey'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">            </span><span class="NAME">this.rsaPrvKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvkey'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpem'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">            </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpas'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">            </span><span class="NAME">this.setRsaPrvKeyByPEMandPass</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpem'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsaprvpas'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>906</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>907</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.CRL</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>908</span> 
<span class='line'>909</span> </span><span class="COMM">/**
<span class='line'>910</span>  * ASN.1 TBSCertList structure class for CRL
<span class='line'>911</span>  * @name KJUR.asn1.x509.TBSCertList
<span class='line'>912</span>  * @class ASN.1 TBSCertList structure class for CRL
<span class='line'>913</span>  * @param {Array} params associative array of parameters (ex. {})
<span class='line'>914</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>915</span>  * @since 1.0.3
<span class='line'>916</span>  * @description
<span class='line'>917</span>  * &lt;br/>
<span class='line'>918</span>  * &lt;h4>EXAMPLE&lt;/h4>
<span class='line'>919</span>  * @example
<span class='line'>920</span>  *  var o = new KJUR.asn1.x509.TBSCertList();
<span class='line'>921</span>  *  o.setSignatureAlgByParam({'name': 'SHA1withRSA'});
<span class='line'>922</span>  *  o.setIssuerByParam({'str': '/C=US/O=a'});
<span class='line'>923</span>  *  o.setNotThisUpdateByParam({'str': '130504235959Z'});
<span class='line'>924</span>  *  o.setNotNextUpdateByParam({'str': '140504235959Z'});
<span class='line'>925</span>  *  o.addRevokedCert({'int': 4}, {'str':'130514235959Z'}));
<span class='line'>926</span>  *  o.addRevokedCert({'hex': '0f34dd'}, {'str':'130514235959Z'}));
<span class='line'>927</span>  * 
<span class='line'>928</span>  * // TBSCertList  ::=  SEQUENCE  {
<span class='line'>929</span>  * //        version                 Version OPTIONAL,
<span class='line'>930</span>  * //                                     -- if present, MUST be v2
<span class='line'>931</span>  * //        signature               AlgorithmIdentifier,
<span class='line'>932</span>  * //        issuer                  Name,
<span class='line'>933</span>  * //        thisUpdate              Time,
<span class='line'>934</span>  * //        nextUpdate              Time OPTIONAL,
<span class='line'>935</span>  * //        revokedCertificates     SEQUENCE OF SEQUENCE  {
<span class='line'>936</span>  * //             userCertificate         CertificateSerialNumber,
<span class='line'>937</span>  * //             revocationDate          Time,
<span class='line'>938</span>  * //             crlEntryExtensions      Extensions OPTIONAL
<span class='line'>939</span>  * //                                      -- if present, version MUST be v2
<span class='line'>940</span>  * //                                  }  OPTIONAL,
<span class='line'>941</span>  * //        crlExtensions           [0]  EXPLICIT Extensions OPTIONAL
<span class='line'>942</span>  */</span><span class="WHIT">
<span class='line'>943</span> </span><span class="NAME">KJUR.asn1.x509.TBSCertList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>944</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.TBSCertList.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>945</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aRevokedCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>946</span> 
<span class='line'>947</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>948</span>      * set signature algorithm field by parameter
<span class='line'>949</span>      * @name setSignatureAlgByParam
<span class='line'>950</span>      * @memberOf KJUR.asn1.x509.TBSCertList
<span class='line'>951</span>      * @function
<span class='line'>952</span>      * @param {Array} algIdParam AlgorithmIdentifier parameter
<span class='line'>953</span>      * @description
<span class='line'>954</span>      * @example
<span class='line'>955</span>      * tbsc.setSignatureAlgByParam({'name': 'SHA1withRSA'});
<span class='line'>956</span>      */</span><span class="WHIT">
<span class='line'>957</span> </span><span class="WHIT">    </span><span class="NAME">this.setSignatureAlgByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">algIdParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>958</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="NAME">algIdParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>960</span> 
<span class='line'>961</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>962</span>      * set issuer name field by parameter
<span class='line'>963</span>      * @name setIssuerByParam
<span class='line'>964</span>      * @memberOf KJUR.asn1.x509.TBSCertList
<span class='line'>965</span>      * @function
<span class='line'>966</span>      * @param {Array} x500NameParam X500Name parameter
<span class='line'>967</span>      * @description
<span class='line'>968</span>      * @example
<span class='line'>969</span>      * tbsc.setIssuerParam({'str': '/C=US/CN=b'});
<span class='line'>970</span>      * @see KJUR.asn1.x509.X500Name
<span class='line'>971</span>      */</span><span class="WHIT">
<span class='line'>972</span> </span><span class="WHIT">    </span><span class="NAME">this.setIssuerByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>973</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Issuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="PUNC">(</span><span class="NAME">x500NameParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>975</span> 
<span class='line'>976</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>977</span>      * set thisUpdate field by parameter
<span class='line'>978</span>      * @name setThisUpdateByParam
<span class='line'>979</span>      * @memberOf KJUR.asn1.x509.TBSCertList
<span class='line'>980</span>      * @function
<span class='line'>981</span>      * @param {Array} timeParam Time parameter
<span class='line'>982</span>      * @description
<span class='line'>983</span>      * @example
<span class='line'>984</span>      * tbsc.setThisUpdateByParam({'str': '130508235959Z'});
<span class='line'>985</span>      * @see KJUR.asn1.x509.Time
<span class='line'>986</span>      */</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">    </span><span class="NAME">this.setThisUpdateByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ThisUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>990</span> 
<span class='line'>991</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>992</span>      * set nextUpdate field by parameter
<span class='line'>993</span>      * @name setNextUpdateByParam
<span class='line'>994</span>      * @memberOf KJUR.asn1.x509.TBSCertList
<span class='line'>995</span>      * @function
<span class='line'>996</span>      * @param {Array} timeParam Time parameter
<span class='line'>997</span>      * @description
<span class='line'>998</span>      * @example
<span class='line'>999</span>      * tbsc.setNextUpdateByParam({'str': '130508235959Z'});
<span class='line'>1000</span>      * @see KJUR.asn1.x509.Time
<span class='line'>1001</span>      */</span><span class="WHIT">
<span class='line'>1002</span> </span><span class="WHIT">    </span><span class="NAME">this.setNextUpdateByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1003</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NextUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1004</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1005</span> 
<span class='line'>1006</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1007</span>      * add revoked certficate by parameter
<span class='line'>1008</span>      * @name addRevokedCert
<span class='line'>1009</span>      * @memberOf KJUR.asn1.x509.TBSCertList
<span class='line'>1010</span>      * @function
<span class='line'>1011</span>      * @param {Array} snParam DERInteger parameter for certificate serial number
<span class='line'>1012</span>      * @param {Array} timeParam Time parameter for revocation date
<span class='line'>1013</span>      * @description
<span class='line'>1014</span>      * @example
<span class='line'>1015</span>      * tbsc.addRevokedCert({'int': 3}, {'str': '130508235959Z'});
<span class='line'>1016</span>      * @see KJUR.asn1.x509.Time
<span class='line'>1017</span>      */</span><span class="WHIT">
<span class='line'>1018</span> </span><span class="WHIT">    </span><span class="NAME">this.addRevokedCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">snParam</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1019</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">param</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1020</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">snParam</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">snParam</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">param</span><span class="PUNC">[</span><span class="STRN">'sn'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">snParam</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1021</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">timeParam</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">param</span><span class="PUNC">[</span><span class="STRN">'time'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeParam</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1022</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.CRLEntry</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="WHIT">        </span><span class="NAME">this.aRevokedCert.push</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1024</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1025</span> 
<span class='line'>1026</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1027</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1028</span> 
<span class='line'>1029</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1Version</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Version</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1030</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1SignatureAlg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1031</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Issuer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1032</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1ThisUpdate</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1033</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1NextUpdate</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">this.asn1NextUpdate</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1034</span> 
<span class='line'>1035</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.aRevokedCert.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1036</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.aRevokedCert</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1037</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">seq</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1038</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1039</span> 
<span class='line'>1040</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1041</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1042</span> </span><span class="WHIT">        </span><span class="NAME">this.isModified</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1043</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1044</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1045</span> 
<span class='line'>1046</span> </span><span class="WHIT">    </span><span class="NAME">this._initialize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1047</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1048</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SignatureAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1049</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Issuer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1050</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1ThisUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1051</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1NextUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1052</span> </span><span class="WHIT">        </span><span class="NAME">this.aRevokedCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1053</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1054</span> 
<span class='line'>1055</span> </span><span class="WHIT">    </span><span class="NAME">this._initialize</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1056</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1057</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.TBSCertList</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1058</span> 
<span class='line'>1059</span> </span><span class="COMM">/**
<span class='line'>1060</span>  * ASN.1 CRLEntry structure class for CRL
<span class='line'>1061</span>  * @name KJUR.asn1.x509.CRLEntry
<span class='line'>1062</span>  * @class ASN.1 CRLEntry structure class for CRL
<span class='line'>1063</span>  * @param {Array} params associative array of parameters (ex. {})
<span class='line'>1064</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1065</span>  * @since 1.0.3
<span class='line'>1066</span>  * @description
<span class='line'>1067</span>  * @example
<span class='line'>1068</span>  * var e = new KJUR.asn1.x509.CRLEntry({'time': {'str': '130514235959Z'}, 'sn': {'int': 234}});
<span class='line'>1069</span>  * 
<span class='line'>1070</span>  * // revokedCertificates     SEQUENCE OF SEQUENCE  {
<span class='line'>1071</span>  * //     userCertificate         CertificateSerialNumber,
<span class='line'>1072</span>  * //     revocationDate          Time,
<span class='line'>1073</span>  * //     crlEntryExtensions      Extensions OPTIONAL
<span class='line'>1074</span>  * //                             -- if present, version MUST be v2 }
<span class='line'>1075</span>  */</span><span class="WHIT">
<span class='line'>1076</span> </span><span class="NAME">KJUR.asn1.x509.CRLEntry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1077</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.CRLEntry.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1078</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1079</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">time</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1080</span> 
<span class='line'>1081</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1082</span>      * set DERInteger parameter for serial number of revoked certificate 
<span class='line'>1083</span>      * @name setCertSerial
<span class='line'>1084</span>      * @memberOf KJUR.asn1.x509.CRLEntry
<span class='line'>1085</span>      * @function
<span class='line'>1086</span>      * @param {Array} intParam DERInteger parameter for certificate serial number
<span class='line'>1087</span>      * @description
<span class='line'>1088</span>      * @example
<span class='line'>1089</span>      * entry.setCertSerial({'int': 3});
<span class='line'>1090</span>      */</span><span class="WHIT">
<span class='line'>1091</span> </span><span class="WHIT">    </span><span class="NAME">this.setCertSerial</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">intParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1092</span> </span><span class="WHIT">        </span><span class="NAME">this.sn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="NAME">intParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1093</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1094</span> 
<span class='line'>1095</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1096</span>      * set Time parameter for revocation date
<span class='line'>1097</span>      * @name setRevocationDate
<span class='line'>1098</span>      * @memberOf KJUR.asn1.x509.CRLEntry
<span class='line'>1099</span>      * @function
<span class='line'>1100</span>      * @param {Array} timeParam Time parameter for revocation date
<span class='line'>1101</span>      * @description
<span class='line'>1102</span>      * @example
<span class='line'>1103</span>      * entry.setRevocationDate({'str': '130508235959Z'});
<span class='line'>1104</span>      */</span><span class="WHIT">
<span class='line'>1105</span> </span><span class="WHIT">    </span><span class="NAME">this.setRevocationDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1106</span> </span><span class="WHIT">        </span><span class="NAME">this.time</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">(</span><span class="NAME">timeParam</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1107</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1108</span> 
<span class='line'>1109</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1110</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.sn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.time</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1111</span> </span><span class="WHIT">        </span><span class="NAME">this.TLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1112</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.TLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1113</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1114</span> </span><span class="WHIT">    
<span class='line'>1115</span>     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1116</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'time'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1117</span> </span><span class="WHIT">            </span><span class="NAME">this.setRevocationDate</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'time'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1118</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1119</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'sn'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1120</span> </span><span class="WHIT">            </span><span class="NAME">this.setCertSerial</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'sn'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1121</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1122</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1123</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1124</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.CRLEntry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1125</span> 
<span class='line'>1126</span> </span><span class="COMM">// === END   CRL Related ===================================================</span><span class="WHIT">
<span class='line'>1127</span> 
<span class='line'>1128</span> </span><span class="COMM">// === BEGIN X500Name Related =================================================</span><span class="WHIT">
<span class='line'>1129</span> </span><span class="COMM">/**
<span class='line'>1130</span>  * X500Name ASN.1 structure class
<span class='line'>1131</span>  * @name KJUR.asn1.x509.X500Name
<span class='line'>1132</span>  * @class X500Name ASN.1 structure class
<span class='line'>1133</span>  * @param {Array} params associative array of parameters (ex. {'str': '/C=US/O=a'})
<span class='line'>1134</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1135</span>  * @description
<span class='line'>1136</span>  * @example
<span class='line'>1137</span>  * // 1. construct with string
<span class='line'>1138</span>  * o = new KJUR.asn1.x509.X500Name({str: "/C=US/O=aaa/OU=bbb/CN=foo@example.com"});
<span class='line'>1139</span>  * // 2. construct by object
<span class='line'>1140</span>  * o = new KJUR.asn1.x509.X500Name({C: "US", O: "aaa", CN: "http://example.com/"});
<span class='line'>1141</span>  */</span><span class="WHIT">
<span class='line'>1142</span> </span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1143</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.X500Name.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1144</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1145</span> 
<span class='line'>1146</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1147</span>      * set DN by string
<span class='line'>1148</span>      * @name setByString
<span class='line'>1149</span>      * @memberOf KJUR.asn1.x509.X500Name
<span class='line'>1150</span>      * @function
<span class='line'>1151</span>      * @param {Array} dnStr distinguished name by string (ex. /C=US/O=aaa)
<span class='line'>1152</span>      * @description
<span class='line'>1153</span>      * @example
<span class='line'>1154</span>      * name = new KJUR.asn1.x509.X500Name();
<span class='line'>1155</span>      * name.setByString("/C=US/O=aaa/OU=bbb/CN=foo@example.com");
<span class='line'>1156</span>      */</span><span class="WHIT">
<span class='line'>1157</span> </span><span class="WHIT">    </span><span class="NAME">this.setByString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dnStr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1158</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dnStr.split</span><span class="PUNC">(</span><span class="STRN">'/'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1159</span> </span><span class="WHIT">        </span><span class="NAME">a.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1160</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1161</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.RDN</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1162</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1163</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1164</span> </span><span class="WHIT">    
<span class='line'>1165</span>     </span><span class="COMM">/**
<span class='line'>1166</span>      * set DN by associative array
<span class='line'>1167</span>      * @name setByObject
<span class='line'>1168</span>      * @memberOf KJUR.asn1.x509.X500Name
<span class='line'>1169</span>      * @function
<span class='line'>1170</span>      * @param {Array} dnObj associative array of DN (ex. {C: "US", O: "aaa"})
<span class='line'>1171</span>      * @since jsrsasign 4.9. asn1x509 1.0.13
<span class='line'>1172</span>      * @description
<span class='line'>1173</span>      * @example
<span class='line'>1174</span>      * name = new KJUR.asn1.x509.X500Name();
<span class='line'>1175</span>      * name.setByObject({C: "US", O: "aaa", CN="http://example.com/"1});
<span class='line'>1176</span>      */</span><span class="WHIT">
<span class='line'>1177</span> </span><span class="WHIT">    </span><span class="NAME">this.setByObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dnObj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1178</span> </span><span class="WHIT">        </span><span class="COMM">// Get all the dnObject attributes and stuff them in the ASN.1 array.</span><span class="WHIT">
<span class='line'>1179</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">dnObj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1180</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dnObj.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1181</span> </span><span class="WHIT">                </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newRDN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.RDN</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>1182</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'='</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dnObj</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1183</span> </span><span class="WHIT">                </span><span class="COMM">// Initialize or push into the ANS1 array.</span><span class="WHIT">
<span class='line'>1184</span> </span><span class="WHIT">                </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">newRDN</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1185</span> </span><span class="WHIT">                    </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">newRDN</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1186</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1187</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1188</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1189</span> 
<span class='line'>1190</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1191</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1192</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1193</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1194</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1195</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1196</span> 
<span class='line'>1197</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1198</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1199</span> </span><span class="WHIT">            </span><span class="NAME">this.setByString</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1200</span> </span><span class="WHIT">        </span><span class="COMM">// If params is an object, then set the ASN1 array just using the object</span><span class="WHIT">
<span class='line'>1201</span> </span><span class="WHIT">        </span><span class="COMM">// attributes. This is nice for fields that have lots of special</span><span class="WHIT">
<span class='line'>1202</span> </span><span class="WHIT">        </span><span class="COMM">// characters (i.e. CN: 'http://www.github.com/kjur//').</span><span class="WHIT">
<span class='line'>1203</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1204</span> </span><span class="WHIT">            </span><span class="NAME">this.setByObject</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1205</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1206</span> </span><span class="WHIT">        
<span class='line'>1207</span>         </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.certissuer</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1208</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1209</span> </span><span class="WHIT">            </span><span class="NAME">x.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509.pemToHex</span><span class="PUNC">(</span><span class="NAME">params.certissuer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1210</span> </span><span class="WHIT">            </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x.getIssuerHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1211</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1212</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.certsubject</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1213</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1214</span> </span><span class="WHIT">            </span><span class="NAME">x.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509.pemToHex</span><span class="PUNC">(</span><span class="NAME">params.certsubject</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1215</span> </span><span class="WHIT">            </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x.getSubjectHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1216</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1217</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1218</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1219</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.X500Name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1220</span> 
<span class='line'>1221</span> </span><span class="COMM">/**
<span class='line'>1222</span>  * RDN (Relative Distinguish Name) ASN.1 structure class
<span class='line'>1223</span>  * @name KJUR.asn1.x509.RDN
<span class='line'>1224</span>  * @class RDN (Relative Distinguish Name) ASN.1 structure class
<span class='line'>1225</span>  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
<span class='line'>1226</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1227</span>  * @description
<span class='line'>1228</span>  * @example
<span class='line'>1229</span>  */</span><span class="WHIT">
<span class='line'>1230</span> </span><span class="NAME">KJUR.asn1.x509.RDN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1231</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.RDN.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1232</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1233</span> 
<span class='line'>1234</span> </span><span class="WHIT">    </span><span class="NAME">this.addByString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rdnStr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1235</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AttributeTypeAndValue</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="NAME">rdnStr</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1236</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1237</span> 
<span class='line'>1238</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1239</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSet</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1240</span> </span><span class="WHIT">        </span><span class="NAME">this.TLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1241</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.TLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1242</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1243</span> 
<span class='line'>1244</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1245</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1246</span> </span><span class="WHIT">            </span><span class="NAME">this.addByString</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1247</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1248</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1249</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1250</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.RDN</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1251</span> 
<span class='line'>1252</span> </span><span class="COMM">/**
<span class='line'>1253</span>  * AttributeTypeAndValue ASN.1 structure class
<span class='line'>1254</span>  * @name KJUR.asn1.x509.AttributeTypeAndValue
<span class='line'>1255</span>  * @class AttributeTypeAndValue ASN.1 structure class
<span class='line'>1256</span>  * @param {Array} params associative array of parameters (ex. {'str': 'C=US'})
<span class='line'>1257</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1258</span>  * @description
<span class='line'>1259</span>  * @example
<span class='line'>1260</span>  */</span><span class="WHIT">
<span class='line'>1261</span> </span><span class="NAME">KJUR.asn1.x509.AttributeTypeAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1262</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.AttributeTypeAndValue.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1263</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">typeObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1264</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valueObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1265</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaultDSType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"utf8"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1266</span> 
<span class='line'>1267</span> </span><span class="WHIT">    </span><span class="NAME">this.setByString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">attrTypeAndValueStr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1268</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrTypeAndValueStr.match</span><span class="PUNC">(</span><span class="REGX">/^([^=]+)=(.+)$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1269</span> </span><span class="WHIT">            </span><span class="NAME">this.setByAttrTypeAndValueStr</span><span class="PUNC">(</span><span class="NAME">RegExp.$1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">RegExp.$2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1270</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1271</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed attrTypeAndValueStr: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">attrTypeAndValueStr</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1272</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1273</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1274</span> 
<span class='line'>1275</span> </span><span class="WHIT">    </span><span class="NAME">this.setByAttrTypeAndValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">shortAttrType</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1276</span> </span><span class="WHIT">        </span><span class="NAME">this.typeObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.atype2obj</span><span class="PUNC">(</span><span class="NAME">shortAttrType</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1277</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">defaultDSType</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1278</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">shortAttrType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"C"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"prn"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1279</span> </span><span class="WHIT">        </span><span class="NAME">this.valueObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getValueObj</span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1280</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1281</span> 
<span class='line'>1282</span> </span><span class="WHIT">    </span><span class="NAME">this.getValueObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1283</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"utf8"</span><span class="PUNC">)</span><span class="WHIT">   </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERUTF8String</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"str"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1284</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"prn"</span><span class="PUNC">)</span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERPrintableString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"str"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1285</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"tel"</span><span class="PUNC">)</span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTeletexString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"str"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1286</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"ia5"</span><span class="PUNC">)</span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERIA5String</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"str"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1287</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"unsupported directory string type: type="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dsType</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" value="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">valueStr</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1288</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1289</span> 
<span class='line'>1290</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1291</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">"array"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.typeObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.valueObj</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1292</span> </span><span class="WHIT">        </span><span class="NAME">this.TLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1293</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.TLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1294</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1295</span> 
<span class='line'>1296</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1297</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1298</span> </span><span class="WHIT">            </span><span class="NAME">this.setByString</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'str'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1299</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1300</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1301</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1302</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.AttributeTypeAndValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1303</span> 
<span class='line'>1304</span> </span><span class="COMM">// === END   X500Name Related =================================================</span><span class="WHIT">
<span class='line'>1305</span> 
<span class='line'>1306</span> </span><span class="COMM">// === BEGIN Other ASN1 structure class  ======================================</span><span class="WHIT">
<span class='line'>1307</span> 
<span class='line'>1308</span> </span><span class="COMM">/**
<span class='line'>1309</span>  * SubjectPublicKeyInfo ASN.1 structure class
<span class='line'>1310</span>  * @name KJUR.asn1.x509.SubjectPublicKeyInfo
<span class='line'>1311</span>  * @class SubjectPublicKeyInfo ASN.1 structure class
<span class='line'>1312</span>  * @param {Object} params parameter for subject public key
<span class='line'>1313</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1314</span>  * @description
<span class='line'>1315</span>  * &lt;br/>
<span class='line'>1316</span>  * As for argument 'params' for constructor, you can specify one of
<span class='line'>1317</span>  * following properties:
<span class='line'>1318</span>  * &lt;ul>
<span class='line'>1319</span>  * &lt;li>{@link RSAKey} object&lt;/li>
<span class='line'>1320</span>  * &lt;li>{@link KJUR.crypto.ECDSA} object&lt;/li>
<span class='line'>1321</span>  * &lt;li>{@link KJUR.crypto.DSA} object&lt;/li>
<span class='line'>1322</span>  * &lt;li>(DEPRECATED)rsakey - specify {@link RSAKey} object of subject public key&lt;/li>
<span class='line'>1323</span>  * &lt;li>(DEPRECATED)rsapem - specify a string of PEM public key of RSA key&lt;/li>
<span class='line'>1324</span>  * &lt;/ul>
<span class='line'>1325</span>  * NOTE1: 'params' can be omitted.&lt;br/>
<span class='line'>1326</span>  * NOTE2: DSA/ECDSA key object is also supported since asn1x509 1.0.6.&lt;br/>
<span class='line'>1327</span>  * &lt;h4>EXAMPLE&lt;/h4>
<span class='line'>1328</span>  * @example
<span class='line'>1329</span>  * var spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(RSAKey_object);
<span class='line'>1330</span>  * var spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoECDSA_object);
<span class='line'>1331</span>  * var spki = new KJUR.asn1.x509.SubjectPublicKeyInfo(KJURcryptoDSA_object);
<span class='line'>1332</span>  */</span><span class="WHIT">
<span class='line'>1333</span> </span><span class="NAME">KJUR.asn1.x509.SubjectPublicKeyInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1334</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1335</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1336</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1337</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1338</span> 
<span class='line'>1339</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1340</span>      * (DEPRECATED) set RSAKey object as subject public key
<span class='line'>1341</span>      * @name setRSAKey
<span class='line'>1342</span>      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo
<span class='line'>1343</span>      * @function
<span class='line'>1344</span>      * @param {RSAKey} rsaKey {@link RSAKey} object for RSA public key
<span class='line'>1345</span>      * @description
<span class='line'>1346</span>      * @deprecated
<span class='line'>1347</span>      * @example
<span class='line'>1348</span>      * spki.setRSAKey(rsaKey);
<span class='line'>1349</span>      */</span><span class="WHIT">
<span class='line'>1350</span> </span><span class="WHIT">    </span><span class="NAME">this.setRSAKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rsaKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1351</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">RSAKey.prototype.isPrototypeOf</span><span class="PUNC">(</span><span class="NAME">rsaKey</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1352</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"argument is not RSAKey instance"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1353</span> </span><span class="WHIT">        </span><span class="NAME">this.rsaKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rsaKey</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1354</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1RsaN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">rsaKey.n</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1355</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1RsaE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">rsaKey.e</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1356</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1RsaPub</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">asn1RsaN</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">asn1RsaE</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1357</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaKeyHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">asn1RsaPub.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1358</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="STRN">'rsaEncryption'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1359</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="STRN">'00'</span><span class="PUNC">+</span><span class="NAME">rsaKeyHex</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1360</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1361</span> 
<span class='line'>1362</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1363</span>      * (DEPRECATED) set a PEM formatted RSA public key string as RSA public key
<span class='line'>1364</span>      * @name setRSAPEM
<span class='line'>1365</span>      * @memberOf KJUR.asn1.x509.SubjectPublicKeyInfo
<span class='line'>1366</span>      * @function
<span class='line'>1367</span>      * @param {String} rsaPubPEM PEM formatted RSA public key string
<span class='line'>1368</span>      * @deprecated
<span class='line'>1369</span>      * @description
<span class='line'>1370</span>      * @example
<span class='line'>1371</span>      * spki.setRSAPEM(rsaPubPEM);
<span class='line'>1372</span>      */</span><span class="WHIT">
<span class='line'>1373</span> </span><span class="WHIT">    </span><span class="NAME">this.setRSAPEM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rsaPubPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1374</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">rsaPubPEM.match</span><span class="PUNC">(</span><span class="REGX">/-----BEGIN PUBLIC KEY-----/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1375</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rsaPubPEM</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1376</span> </span><span class="WHIT">            </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/^-----[^-]+-----/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1377</span> </span><span class="WHIT">            </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/-----[^-]+-----\s*$/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1378</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaB64</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/\s+/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1379</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaWA</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Base64.parse</span><span class="PUNC">(</span><span class="NAME">rsaB64</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1380</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaP8Hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">CryptoJS.enc.Hex.stringify</span><span class="PUNC">(</span><span class="NAME">rsaWA</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1381</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_rsapem_getHexValueArrayOfChildrenFromHex</span><span class="PUNC">(</span><span class="NAME">rsaP8Hex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1382</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hBitStrVal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1383</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hBitStrVal.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1384</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a3</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_rsapem_getHexValueArrayOfChildrenFromHex</span><span class="PUNC">(</span><span class="NAME">rsaHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1385</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RSAKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1386</span> </span><span class="WHIT">            </span><span class="NAME">rsaKey.setPublic</span><span class="PUNC">(</span><span class="NAME">a3</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a3</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1387</span> </span><span class="WHIT">            </span><span class="NAME">this.setRSAKey</span><span class="PUNC">(</span><span class="NAME">rsaKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1388</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1389</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"key not supported"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1390</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1391</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1392</span> 
<span class='line'>1393</span> </span><span class="WHIT">    </span><span class="COMM">/*
<span class='line'>1394</span>      * @since asn1x509 1.0.7
<span class='line'>1395</span>      */</span><span class="WHIT">
<span class='line'>1396</span> </span><span class="WHIT">    </span><span class="NAME">this.getASN1Object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1397</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1398</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"algId and/or subjPubKey not set"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1399</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>1400</span> </span><span class="WHIT">                                           </span><span class="PUNC">[</span><span class="NAME">this.asn1AlgId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.asn1SubjPKey</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1401</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1402</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1403</span> 
<span class='line'>1404</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1405</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1406</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1407</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1408</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1409</span> 
<span class='line'>1410</span> </span><span class="WHIT">    </span><span class="NAME">this._setRSAKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1411</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1RsaPub</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.newObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1412</span> </span><span class="WHIT">            </span><span class="STRN">'seq'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.n</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.e</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>1413</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1414</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rsaKeyHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">asn1RsaPub.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1415</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="STRN">'rsaEncryption'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1416</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="STRN">'00'</span><span class="PUNC">+</span><span class="NAME">rsaKeyHex</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1417</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1418</span> 
<span class='line'>1419</span> </span><span class="WHIT">    </span><span class="NAME">this._setEC</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1420</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERObjectIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.curveName</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1421</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>1422</span>             </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'ecPublicKey'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1423</span> </span><span class="WHIT">                                                    </span><span class="STRN">'asn1params'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">asn1Params</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1424</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">key.pubKeyHex</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1425</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1426</span> 
<span class='line'>1427</span> </span><span class="WHIT">    </span><span class="NAME">this._setDSA</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1428</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.newObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1429</span> </span><span class="WHIT">            </span><span class="STRN">'seq'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.p</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1430</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.q</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1431</span> </span><span class="WHIT">                    </span><span class="PUNC">{</span><span class="STRN">'int'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.g</span><span class="PUNC">}</span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>1432</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1433</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1AlgId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> 
<span class='line'>1434</span>             </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'name'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'dsa'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1435</span> </span><span class="WHIT">                                                    </span><span class="STRN">'asn1params'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">asn1Params</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1436</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pubInt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'bigint'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">key.y</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1437</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1SubjPKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'hex'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pubInt.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1438</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1439</span> 
<span class='line'>1440</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1441</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">RSAKey</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">RSAKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1442</span> </span><span class="WHIT">            </span><span class="NAME">this._setRSAKey</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1443</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.ECDSA</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>1444</span> </span><span class="WHIT">                   </span><span class="NAME">params</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.ECDSA</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1445</span> </span><span class="WHIT">            </span><span class="NAME">this._setEC</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1446</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.DSA</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
<span class='line'>1447</span> </span><span class="WHIT">                   </span><span class="NAME">params</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.DSA</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1448</span> </span><span class="WHIT">            </span><span class="NAME">this._setDSA</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1449</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsakey'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1450</span> </span><span class="WHIT">            </span><span class="NAME">this.setRSAKey</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsakey'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1451</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsapem'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1452</span> </span><span class="WHIT">            </span><span class="NAME">this.setRSAPEM</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'rsapem'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1453</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1454</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1455</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1456</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.SubjectPublicKeyInfo</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1457</span> 
<span class='line'>1458</span> </span><span class="COMM">/**
<span class='line'>1459</span>  * Time ASN.1 structure class
<span class='line'>1460</span>  * @name KJUR.asn1.x509.Time
<span class='line'>1461</span>  * @class Time ASN.1 structure class
<span class='line'>1462</span>  * @param {Array} params associative array of parameters (ex. {'str': '130508235959Z'})
<span class='line'>1463</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1464</span>  * @description
<span class='line'>1465</span>  * &lt;br/>
<span class='line'>1466</span>  * &lt;h4>EXAMPLES&lt;/h4>
<span class='line'>1467</span>  * @example
<span class='line'>1468</span>  * var t1 = new KJUR.asn1.x509.Time{'str': '130508235959Z'} // UTCTime by default
<span class='line'>1469</span>  * var t2 = new KJUR.asn1.x509.Time{'type': 'gen',  'str': '20130508235959Z'} // GeneralizedTime
<span class='line'>1470</span>  */</span><span class="WHIT">
<span class='line'>1471</span> </span><span class="NAME">KJUR.asn1.x509.Time</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1472</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.Time.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1473</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1474</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timeParams</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1475</span> 
<span class='line'>1476</span> </span><span class="WHIT">    </span><span class="NAME">this.setTimeParams</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeParams</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1477</span> </span><span class="WHIT">        </span><span class="NAME">this.timeParams</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeParams</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1478</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1479</span> 
<span class='line'>1480</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1481</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1482</span> 
<span class='line'>1483</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.timeParams</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1484</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"utc"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1485</span> </span><span class="WHIT">                </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERUTCTime</span><span class="PUNC">(</span><span class="NAME">this.timeParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1486</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1487</span> </span><span class="WHIT">                </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERGeneralizedTime</span><span class="PUNC">(</span><span class="NAME">this.timeParams</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1488</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1489</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1490</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"utc"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1491</span> </span><span class="WHIT">                </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERUTCTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1492</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1493</span> </span><span class="WHIT">                </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERGeneralizedTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1494</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1495</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1496</span> </span><span class="WHIT">        </span><span class="NAME">this.TLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1497</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.TLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1498</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1499</span> </span><span class="WHIT">    
<span class='line'>1500</span>     </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"utc"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1501</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1502</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.type</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1503</span> </span><span class="WHIT">            </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.type</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1504</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1505</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.str</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1506</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.str.match</span><span class="PUNC">(</span><span class="REGX">/^[0-9]{12}Z$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"utc"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1507</span> </span><span class="WHIT">                </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.str.match</span><span class="PUNC">(</span><span class="REGX">/^[0-9]{14}Z$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"gen"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1508</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1509</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1510</span> </span><span class="WHIT">        </span><span class="NAME">this.timeParams</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1511</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1512</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1513</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.Time</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1514</span> 
<span class='line'>1515</span> </span><span class="COMM">/**
<span class='line'>1516</span>  * AlgorithmIdentifier ASN.1 structure class
<span class='line'>1517</span>  * @name KJUR.asn1.x509.AlgorithmIdentifier
<span class='line'>1518</span>  * @class AlgorithmIdentifier ASN.1 structure class
<span class='line'>1519</span>  * @param {Array} params associative array of parameters (ex. {'name': 'SHA1withRSA'})
<span class='line'>1520</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>1521</span>  * @description
<span class='line'>1522</span>  * @example
<span class='line'>1523</span>  */</span><span class="WHIT">
<span class='line'>1524</span> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1525</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1526</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nameAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1527</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Alg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1528</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1529</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">paramEmpty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1530</span> 
<span class='line'>1531</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1532</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.nameAlg</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.asn1Alg</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1533</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"algorithm not specified"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1534</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1535</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.nameAlg</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.asn1Alg</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1536</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Alg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.name2obj</span><span class="PUNC">(</span><span class="NAME">this.nameAlg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1537</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1538</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.asn1Alg</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1539</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">this.paramEmpty</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">this.asn1Params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1540</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1541</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1542</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1543</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1544</span> 
<span class='line'>1545</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1546</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'name'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1547</span> </span><span class="WHIT">            </span><span class="NAME">this.nameAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'name'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1548</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1549</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'asn1params'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1550</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'asn1params'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1551</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1552</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'paramempty'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1553</span> </span><span class="WHIT">            </span><span class="NAME">this.paramEmpty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'paramempty'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1554</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1555</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1556</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1Params</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1557</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERNull</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1558</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1559</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1560</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1561</span> 
<span class='line'>1562</span> </span><span class="COMM">/**
<span class='line'>1563</span>  * GeneralName ASN.1 structure class
<span class='line'>1564</span>  * @name KJUR.asn1.x509.GeneralName
<span class='line'>1565</span>  * @class GeneralName ASN.1 structure class
<span class='line'>1566</span>  * @description
<span class='line'>1567</span>  * &lt;br/>
<span class='line'>1568</span>  * As for argument 'params' for constructor, you can specify one of
<span class='line'>1569</span>  * following properties:
<span class='line'>1570</span>  * &lt;ul>
<span class='line'>1571</span>  * &lt;li>rfc822 - rfc822Name[1] (ex. user1@foo.com)&lt;/li>
<span class='line'>1572</span>  * &lt;li>dns - dNSName[2] (ex. foo.com)&lt;/li>
<span class='line'>1573</span>  * &lt;li>uri - uniformResourceIdentifier[6] (ex. http://foo.com/)&lt;/li>
<span class='line'>1574</span>  * &lt;li>certissuer - directoryName[4] (PEM or hex string of cert)&lt;/li>
<span class='line'>1575</span>  * &lt;li>certsubj - directoryName[4] (PEM or hex string of cert)&lt;/li>
<span class='line'>1576</span>  * &lt;/ul>
<span class='line'>1577</span>  * NOTE1: certissuer and certsubj is supported since asn1x509 1.0.10.
<span class='line'>1578</span>  *
<span class='line'>1579</span>  * Here is definition of the ASN.1 syntax:
<span class='line'>1580</span>  * &lt;pre>
<span class='line'>1581</span>  * -- NOTE: under the CHOICE, it will always be explicit.
<span class='line'>1582</span>  * GeneralName ::= CHOICE {
<span class='line'>1583</span>  *         otherName                       [0]     OtherName,
<span class='line'>1584</span>  *         rfc822Name                      [1]     IA5String,
<span class='line'>1585</span>  *         dNSName                         [2]     IA5String,
<span class='line'>1586</span>  *         x400Address                     [3]     ORAddress,
<span class='line'>1587</span>  *         directoryName                   [4]     Name,
<span class='line'>1588</span>  *         ediPartyName                    [5]     EDIPartyName,
<span class='line'>1589</span>  *         uniformResourceIdentifier       [6]     IA5String,
<span class='line'>1590</span>  *         iPAddress                       [7]     OCTET STRING,
<span class='line'>1591</span>  *         registeredID                    [8]     OBJECT IDENTIFIER } 
<span class='line'>1592</span>  * &lt;/pre>
<span class='line'>1593</span>  *
<span class='line'>1594</span>  * 
<span class='line'>1595</span>  *
<span class='line'>1596</span>  * @example
<span class='line'>1597</span>  * gn = new KJUR.asn1.x509.GeneralName({rfc822:      'test@aaa.com'});
<span class='line'>1598</span>  * gn = new KJUR.asn1.x509.GeneralName({dns:         'aaa.com'});
<span class='line'>1599</span>  * gn = new KJUR.asn1.x509.GeneralName({uri:         'http://aaa.com/'});
<span class='line'>1600</span>  * gn = new KJUR.asn1.x509.GeneralName({certissuer:  certPEM});
<span class='line'>1601</span>  * gn = new KJUR.asn1.x509.GeneralName({certsubj:    certPEM});
<span class='line'>1602</span>  */</span><span class="WHIT">
<span class='line'>1603</span> </span><span class="NAME">KJUR.asn1.x509.GeneralName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1604</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.GeneralName.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1605</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1606</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1607</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">rfc822</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'81'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'82'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">dn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'a4'</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="NAME">uri</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'86'</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1608</span> </span><span class="WHIT">    </span><span class="NAME">this.explicit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1609</span> 
<span class='line'>1610</span> </span><span class="WHIT">    </span><span class="NAME">this.setByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1611</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1612</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1613</span> 
<span class='line'>1614</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1615</span> </span><span class="WHIT">		
<span class='line'>1616</span>         </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.rfc822</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1617</span> </span><span class="WHIT">            </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'rfc822'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1618</span> </span><span class="WHIT">            </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERIA5String</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="NAME">this.type</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1619</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1620</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.dns</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1621</span> </span><span class="WHIT">            </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'dns'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1622</span> </span><span class="WHIT">            </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERIA5String</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="NAME">this.type</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1623</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1624</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.uri</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1625</span> </span><span class="WHIT">            </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'uri'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1626</span> </span><span class="WHIT">            </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERIA5String</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'str'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="NAME">this.type</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1627</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1628</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.certissuer</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1629</span> </span><span class="WHIT">			</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'dn'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1630</span> </span><span class="WHIT">			</span><span class="NAME">this.explicit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1631</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">certStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.certissuer</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1632</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1633</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certStr.match</span><span class="PUNC">(</span><span class="REGX">/^[0-9A-Fa-f]+$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1634</span> </span><span class="WHIT">				</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">certStr</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1635</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1636</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certStr.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN "</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1637</span> </span><span class="WHIT">				</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509.pemToHex</span><span class="PUNC">(</span><span class="NAME">certStr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1638</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1639</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"certissuer param not cert"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1640</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1641</span> </span><span class="WHIT">			</span><span class="NAME">x.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">certHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1642</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dnHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x.getIssuerHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1643</span> </span><span class="WHIT">			</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1644</span> </span><span class="WHIT">			</span><span class="NAME">v.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dnHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1645</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1646</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.certsubj</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1647</span> </span><span class="WHIT">			</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'dn'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1648</span> </span><span class="WHIT">			</span><span class="NAME">this.explicit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1649</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">certStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.certsubj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1650</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1651</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certStr.match</span><span class="PUNC">(</span><span class="REGX">/^[0-9A-Fa-f]+$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1652</span> </span><span class="WHIT">				</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">certStr</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1653</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1654</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certStr.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN "</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1655</span> </span><span class="WHIT">				</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509.pemToHex</span><span class="PUNC">(</span><span class="NAME">certStr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1656</span> </span><span class="WHIT">			</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1657</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">certHex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"certsubj param not cert"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1658</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1659</span> </span><span class="WHIT">			</span><span class="NAME">x.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">certHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1660</span> </span><span class="WHIT">			</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dnHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x.getSubjectHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1661</span> </span><span class="WHIT">			</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1662</span> </span><span class="WHIT">			</span><span class="NAME">v.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dnHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1663</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1664</span> 
<span class='line'>1665</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1666</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"unsupported type in params="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1667</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.explicit</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1668</span> </span><span class="WHIT">                                                      </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">pTag</span><span class="PUNC">[</span><span class="NAME">this.type</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1669</span> </span><span class="WHIT">                                                      </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1670</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1671</span> 
<span class='line'>1672</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1673</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.asn1Obj.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1674</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1675</span> 
<span class='line'>1676</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1677</span> </span><span class="WHIT">        </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1678</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1679</span> 
<span class='line'>1680</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1681</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.GeneralName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1682</span> 
<span class='line'>1683</span> </span><span class="COMM">/**
<span class='line'>1684</span>  * GeneralNames ASN.1 structure class
<span class='line'>1685</span>  * @name KJUR.asn1.x509.GeneralNames
<span class='line'>1686</span>  * @class GeneralNames ASN.1 structure class
<span class='line'>1687</span>  * @description
<span class='line'>1688</span>  * &lt;br/>
<span class='line'>1689</span>  * &lt;h4>EXAMPLE AND ASN.1 SYNTAX&lt;/h4>
<span class='line'>1690</span>  * @example
<span class='line'>1691</span>  * var gns = new KJUR.asn1.x509.GeneralNames([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]); 
<span class='line'>1692</span>  *
<span class='line'>1693</span>  * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
<span class='line'>1694</span>  */</span><span class="WHIT">
<span class='line'>1695</span> </span><span class="NAME">KJUR.asn1.x509.GeneralNames</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramsArray</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1696</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.GeneralNames.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1697</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1698</span> 
<span class='line'>1699</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1700</span>      * set a array of {@link KJUR.asn1.x509.GeneralName} parameters
<span class='line'>1701</span>      * @name setByParamArray
<span class='line'>1702</span>      * @memberOf KJUR.asn1.x509.GeneralNames
<span class='line'>1703</span>      * @function
<span class='line'>1704</span>      * @param {Array} paramsArray Array of {@link KJUR.asn1.x509.GeneralNames}
<span class='line'>1705</span>      * @description
<span class='line'>1706</span>      * &lt;br/>
<span class='line'>1707</span>      * &lt;h4>EXAMPLES&lt;/h4>
<span class='line'>1708</span>      * @example
<span class='line'>1709</span>      * var gns = new KJUR.asn1.x509.GeneralNames();
<span class='line'>1710</span>      * gns.setByParamArray([{'uri': 'http://aaa.com/'}, {'uri': 'http://bbb.com/'}]);
<span class='line'>1711</span>      */</span><span class="WHIT">
<span class='line'>1712</span> </span><span class="WHIT">    </span><span class="NAME">this.setByParamArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">paramsArray</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1713</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">paramsArray.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1714</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.GeneralName</span><span class="PUNC">(</span><span class="NAME">paramsArray</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1715</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1Array.push</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1716</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1717</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1718</span> 
<span class='line'>1719</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1720</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'array'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1Array</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1721</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">o.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1722</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1723</span> 
<span class='line'>1724</span> </span><span class="WHIT">    </span><span class="NAME">this.asn1Array</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1725</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">paramsArray</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1726</span> </span><span class="WHIT">        </span><span class="NAME">this.setByParamArray</span><span class="PUNC">(</span><span class="NAME">paramsArray</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1727</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1728</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1729</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.GeneralNames</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1730</span> 
<span class='line'>1731</span> </span><span class="COMM">/**
<span class='line'>1732</span>  * DistributionPointName ASN.1 structure class
<span class='line'>1733</span>  * @name KJUR.asn1.x509.DistributionPointName
<span class='line'>1734</span>  * @class DistributionPointName ASN.1 structure class
<span class='line'>1735</span>  * @description
<span class='line'>1736</span>  * @example
<span class='line'>1737</span>  */</span><span class="WHIT">
<span class='line'>1738</span> </span><span class="NAME">KJUR.asn1.x509.DistributionPointName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">gnOrRdn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1739</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.DistributionPointName.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1740</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1Obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1741</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1742</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1743</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1V</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1744</span> 
<span class='line'>1745</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1746</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"full"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1747</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"currently type shall be 'full': "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1748</span> </span><span class="WHIT">        </span><span class="NAME">this.asn1Obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1749</span> </span><span class="WHIT">                                                      </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.tag</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1750</span> </span><span class="WHIT">                                                      </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1V</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1751</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.asn1Obj.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1752</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1753</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1754</span> 
<span class='line'>1755</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">gnOrRdn</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1756</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.GeneralNames.prototype.isPrototypeOf</span><span class="PUNC">(</span><span class="NAME">gnOrRdn</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1757</span> </span><span class="WHIT">            </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"full"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1758</span> </span><span class="WHIT">            </span><span class="NAME">this.tag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"a0"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1759</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1V</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">gnOrRdn</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1760</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1761</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"This class supports GeneralNames only as argument"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1762</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1763</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1764</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1765</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.DistributionPointName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1766</span> 
<span class='line'>1767</span> </span><span class="COMM">/**
<span class='line'>1768</span>  * DistributionPoint ASN.1 structure class
<span class='line'>1769</span>  * @name KJUR.asn1.x509.DistributionPoint
<span class='line'>1770</span>  * @class DistributionPoint ASN.1 structure class
<span class='line'>1771</span>  * @description
<span class='line'>1772</span>  * @example
<span class='line'>1773</span>  */</span><span class="WHIT">
<span class='line'>1774</span> </span><span class="NAME">KJUR.asn1.x509.DistributionPoint</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1775</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.x509.DistributionPoint.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1776</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1DP</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1777</span> 
<span class='line'>1778</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1779</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1780</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.asn1DP</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1781</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERTaggedObject</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'explicit'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1782</span> </span><span class="WHIT">                                                    </span><span class="STRN">'tag'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'a0'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1783</span> </span><span class="WHIT">                                                    </span><span class="STRN">'obj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.asn1DP</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1784</span> </span><span class="WHIT">            </span><span class="NAME">seq.appendASN1Object</span><span class="PUNC">(</span><span class="NAME">o1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1785</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1786</span> </span><span class="WHIT">        </span><span class="NAME">this.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1787</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.hTLV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1788</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1789</span> 
<span class='line'>1790</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1791</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'dpobj'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1792</span> </span><span class="WHIT">            </span><span class="NAME">this.asn1DP</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">[</span><span class="STRN">'dpobj'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1793</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1794</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1795</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1796</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.x509.DistributionPoint</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1797</span> 
<span class='line'>1798</span> </span><span class="COMM">/**
<span class='line'>1799</span>  * static object for OID
<span class='line'>1800</span>  * @name KJUR.asn1.x509.OID
<span class='line'>1801</span>  * @class static object for OID
<span class='line'>1802</span>  * @property {Assoc Array} atype2oidList for short attribyte type name and oid (i.e. 'C' and '2.5.4.6')
<span class='line'>1803</span>  * @property {Assoc Array} name2oidList for oid name and oid (i.e. 'keyUsage' and '2.5.29.15')
<span class='line'>1804</span>  * @property {Assoc Array} objCache for caching name and DERObjectIdentifier object 
<span class='line'>1805</span>  * @description
<span class='line'>1806</span>  * &lt;dl>
<span class='line'>1807</span>  * &lt;dt>&lt;b>atype2oidList&lt;/b>
<span class='line'>1808</span>  * &lt;dd>currently supports 'C', 'O', 'OU', 'ST', 'L' and 'CN' only.
<span class='line'>1809</span>  * &lt;dt>&lt;b>name2oidList&lt;/b>
<span class='line'>1810</span>  * &lt;dd>currently supports 'SHA1withRSA', 'rsaEncryption' and some extension OIDs
<span class='line'>1811</span>  * &lt;/dl>
<span class='line'>1812</span>  * @example
<span class='line'>1813</span>  */</span><span class="WHIT">
<span class='line'>1814</span> </span><span class="NAME">KJUR.asn1.x509.OID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1815</span> </span><span class="WHIT">    </span><span class="NAME">this.atype2oidList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1816</span> </span><span class="WHIT">        </span><span class="STRN">'C'</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="STRN">'2.5.4.6'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1817</span> </span><span class="WHIT">        </span><span class="STRN">'O'</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="STRN">'2.5.4.10'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1818</span> </span><span class="WHIT">        </span><span class="STRN">'OU'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'2.5.4.11'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1819</span> </span><span class="WHIT">        </span><span class="STRN">'ST'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'2.5.4.8'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1820</span> </span><span class="WHIT">        </span><span class="STRN">'L'</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="STRN">'2.5.4.7'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1821</span> </span><span class="WHIT">        </span><span class="STRN">'CN'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'2.5.4.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1822</span> </span><span class="WHIT">        </span><span class="STRN">'DN'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'2.5.4.49'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1823</span> </span><span class="WHIT">        </span><span class="STRN">'DC'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'0.9.2342.19200300.100.1.25'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1824</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1825</span> </span><span class="WHIT">    </span><span class="NAME">this.name2oidList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1826</span> </span><span class="WHIT">        </span><span class="STRN">'sha1'</span><span class="PUNC">:</span><span class="WHIT">                 </span><span class="STRN">'1.3.14.3.2.26'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1827</span> </span><span class="WHIT">        </span><span class="STRN">'sha256'</span><span class="PUNC">:</span><span class="WHIT">               </span><span class="STRN">'2.16.840.1.101.3.4.2.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1828</span> </span><span class="WHIT">        </span><span class="STRN">'sha384'</span><span class="PUNC">:</span><span class="WHIT">               </span><span class="STRN">'2.16.840.1.101.3.4.2.2'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1829</span> </span><span class="WHIT">        </span><span class="STRN">'sha512'</span><span class="PUNC">:</span><span class="WHIT">               </span><span class="STRN">'2.16.840.1.101.3.4.2.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1830</span> </span><span class="WHIT">        </span><span class="STRN">'sha224'</span><span class="PUNC">:</span><span class="WHIT">               </span><span class="STRN">'2.16.840.1.101.3.4.2.4'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1831</span> </span><span class="WHIT">        </span><span class="STRN">'md5'</span><span class="PUNC">:</span><span class="WHIT">                  </span><span class="STRN">'1.2.840.113549.2.5'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1832</span> </span><span class="WHIT">        </span><span class="STRN">'md2'</span><span class="PUNC">:</span><span class="WHIT">                  </span><span class="STRN">'1.3.14.7.2.2.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1833</span> </span><span class="WHIT">        </span><span class="STRN">'ripemd160'</span><span class="PUNC">:</span><span class="WHIT">            </span><span class="STRN">'1.3.36.3.2.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1834</span> 
<span class='line'>1835</span> </span><span class="WHIT">        </span><span class="STRN">'MD2withRSA'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.2.840.113549.1.1.2'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1836</span> </span><span class="WHIT">        </span><span class="STRN">'MD4withRSA'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.2.840.113549.1.1.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1837</span> </span><span class="WHIT">        </span><span class="STRN">'MD5withRSA'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.2.840.113549.1.1.4'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1838</span> </span><span class="WHIT">        </span><span class="STRN">'SHA1withRSA'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.2.840.113549.1.1.5'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1839</span> </span><span class="WHIT">        </span><span class="STRN">'SHA224withRSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.1.14'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1840</span> </span><span class="WHIT">        </span><span class="STRN">'SHA256withRSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.1.11'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1841</span> </span><span class="WHIT">        </span><span class="STRN">'SHA384withRSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.1.12'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1842</span> </span><span class="WHIT">        </span><span class="STRN">'SHA512withRSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.1.13'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1843</span> 
<span class='line'>1844</span> </span><span class="WHIT">        </span><span class="STRN">'SHA1withECDSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.10045.4.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1845</span> </span><span class="WHIT">        </span><span class="STRN">'SHA224withECDSA'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'1.2.840.10045.4.3.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1846</span> </span><span class="WHIT">        </span><span class="STRN">'SHA256withECDSA'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'1.2.840.10045.4.3.2'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1847</span> </span><span class="WHIT">        </span><span class="STRN">'SHA384withECDSA'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'1.2.840.10045.4.3.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1848</span> </span><span class="WHIT">        </span><span class="STRN">'SHA512withECDSA'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'1.2.840.10045.4.3.4'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1849</span> 
<span class='line'>1850</span> </span><span class="WHIT">        </span><span class="STRN">'dsa'</span><span class="PUNC">:</span><span class="WHIT">                  </span><span class="STRN">'1.2.840.10040.4.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1851</span> </span><span class="WHIT">        </span><span class="STRN">'SHA1withDSA'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.2.840.10040.4.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1852</span> </span><span class="WHIT">        </span><span class="STRN">'SHA224withDSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'2.16.840.1.101.3.4.3.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1853</span> </span><span class="WHIT">        </span><span class="STRN">'SHA256withDSA'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'2.16.840.1.101.3.4.3.2'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1854</span> 
<span class='line'>1855</span> </span><span class="WHIT">        </span><span class="STRN">'rsaEncryption'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.1.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1856</span> 
<span class='line'>1857</span> </span><span class="WHIT">        </span><span class="STRN">'countryName'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'2.5.4.6'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1858</span> </span><span class="WHIT">        </span><span class="STRN">'organization'</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="STRN">'2.5.4.10'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1859</span> </span><span class="WHIT">        </span><span class="STRN">'organizationalUnit'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'2.5.4.11'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1860</span> </span><span class="WHIT">        </span><span class="STRN">'stateOrProvinceName'</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="STRN">'2.5.4.8'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1861</span> </span><span class="WHIT">        </span><span class="STRN">'locality'</span><span class="PUNC">:</span><span class="WHIT">             </span><span class="STRN">'2.5.4.7'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1862</span> </span><span class="WHIT">        </span><span class="STRN">'commonName'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'2.5.4.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1863</span> 
<span class='line'>1864</span> </span><span class="WHIT">        </span><span class="STRN">'subjectKeyIdentifier'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'2.5.29.14'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1865</span> </span><span class="WHIT">        </span><span class="STRN">'keyUsage'</span><span class="PUNC">:</span><span class="WHIT">             </span><span class="STRN">'2.5.29.15'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1866</span> </span><span class="WHIT">        </span><span class="STRN">'subjectAltName'</span><span class="PUNC">:</span><span class="WHIT">       </span><span class="STRN">'2.5.29.17'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1867</span> </span><span class="WHIT">        </span><span class="STRN">'basicConstraints'</span><span class="PUNC">:</span><span class="WHIT">     </span><span class="STRN">'2.5.29.19'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1868</span> </span><span class="WHIT">        </span><span class="STRN">'nameConstraints'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'2.5.29.30'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1869</span> </span><span class="WHIT">        </span><span class="STRN">'cRLDistributionPoints'</span><span class="PUNC">:</span><span class="STRN">'2.5.29.31'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1870</span> </span><span class="WHIT">        </span><span class="STRN">'certificatePolicies'</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="STRN">'2.5.29.32'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1871</span> </span><span class="WHIT">        </span><span class="STRN">'authorityKeyIdentifier'</span><span class="PUNC">:</span><span class="STRN">'2.5.29.35'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1872</span> </span><span class="WHIT">        </span><span class="STRN">'policyConstraints'</span><span class="PUNC">:</span><span class="WHIT">    </span><span class="STRN">'2.5.29.36'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1873</span> </span><span class="WHIT">        </span><span class="STRN">'extKeyUsage'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'2.5.29.37'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1874</span> </span><span class="WHIT">	</span><span class="STRN">'authorityInfoAccess'</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="STRN">'1.3.6.1.5.5.7.1.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1875</span> 
<span class='line'>1876</span> </span><span class="WHIT">        </span><span class="STRN">'anyExtendedKeyUsage'</span><span class="PUNC">:</span><span class="WHIT">  </span><span class="STRN">'2.5.29.37.0'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1877</span> </span><span class="WHIT">        </span><span class="STRN">'serverAuth'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.3.6.1.5.5.7.3.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1878</span> </span><span class="WHIT">        </span><span class="STRN">'clientAuth'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.3.6.1.5.5.7.3.2'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1879</span> </span><span class="WHIT">        </span><span class="STRN">'codeSigning'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.3.6.1.5.5.7.3.3'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1880</span> </span><span class="WHIT">        </span><span class="STRN">'emailProtection'</span><span class="PUNC">:</span><span class="WHIT">      </span><span class="STRN">'1.3.6.1.5.5.7.3.4'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1881</span> </span><span class="WHIT">        </span><span class="STRN">'timeStamping'</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="STRN">'1.3.6.1.5.5.7.3.8'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1882</span> </span><span class="WHIT">        </span><span class="STRN">'ocspSigning'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.3.6.1.5.5.7.3.9'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1883</span> 
<span class='line'>1884</span> </span><span class="WHIT">        </span><span class="STRN">'ecPublicKey'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.2.840.10045.2.1'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1885</span> </span><span class="WHIT">        </span><span class="STRN">'secp256r1'</span><span class="PUNC">:</span><span class="WHIT">            </span><span class="STRN">'1.2.840.10045.3.1.7'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1886</span> </span><span class="WHIT">        </span><span class="STRN">'secp256k1'</span><span class="PUNC">:</span><span class="WHIT">            </span><span class="STRN">'1.3.132.0.10'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1887</span> </span><span class="WHIT">        </span><span class="STRN">'secp384r1'</span><span class="PUNC">:</span><span class="WHIT">            </span><span class="STRN">'1.3.132.0.34'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1888</span> 
<span class='line'>1889</span> </span><span class="WHIT">        </span><span class="STRN">'pkcs5PBES2'</span><span class="PUNC">:</span><span class="WHIT">           </span><span class="STRN">'1.2.840.113549.1.5.13'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1890</span> </span><span class="WHIT">        </span><span class="STRN">'pkcs5PBKDF2'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.2.840.113549.1.5.12'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1891</span> 
<span class='line'>1892</span> </span><span class="WHIT">        </span><span class="STRN">'des-EDE3-CBC'</span><span class="PUNC">:</span><span class="WHIT">         </span><span class="STRN">'1.2.840.113549.3.7'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1893</span> 
<span class='line'>1894</span> </span><span class="WHIT">        </span><span class="STRN">'data'</span><span class="PUNC">:</span><span class="WHIT">                 </span><span class="STRN">'1.2.840.113549.1.7.1'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS data</span><span class="WHIT">
<span class='line'>1895</span> </span><span class="WHIT">        </span><span class="STRN">'signed-data'</span><span class="PUNC">:</span><span class="WHIT">          </span><span class="STRN">'1.2.840.113549.1.7.2'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS signed-data</span><span class="WHIT">
<span class='line'>1896</span> </span><span class="WHIT">        </span><span class="STRN">'enveloped-data'</span><span class="PUNC">:</span><span class="WHIT">       </span><span class="STRN">'1.2.840.113549.1.7.3'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS enveloped-data</span><span class="WHIT">
<span class='line'>1897</span> </span><span class="WHIT">        </span><span class="STRN">'digested-data'</span><span class="PUNC">:</span><span class="WHIT">        </span><span class="STRN">'1.2.840.113549.1.7.5'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS digested-data</span><span class="WHIT">
<span class='line'>1898</span> </span><span class="WHIT">        </span><span class="STRN">'encrypted-data'</span><span class="PUNC">:</span><span class="WHIT">       </span><span class="STRN">'1.2.840.113549.1.7.6'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS encrypted-data</span><span class="WHIT">
<span class='line'>1899</span> </span><span class="WHIT">        </span><span class="STRN">'authenticated-data'</span><span class="PUNC">:</span><span class="WHIT">   </span><span class="STRN">'1.2.840.113549.1.9.16.1.2'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// CMS authenticated-data</span><span class="WHIT">
<span class='line'>1900</span> </span><span class="WHIT">        </span><span class="STRN">'tstinfo'</span><span class="PUNC">:</span><span class="WHIT">              </span><span class="STRN">'1.2.840.113549.1.9.16.1.4'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// RFC3161 TSTInfo</span><span class="WHIT">
<span class='line'>1901</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1902</span> 
<span class='line'>1903</span> </span><span class="WHIT">    </span><span class="NAME">this.objCache</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1904</span> 
<span class='line'>1905</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1906</span>      * get DERObjectIdentifier by registered OID name
<span class='line'>1907</span>      * @name name2obj
<span class='line'>1908</span>      * @memberOf KJUR.asn1.x509.OID
<span class='line'>1909</span>      * @function
<span class='line'>1910</span>      * @param {String} name OID
<span class='line'>1911</span>      * @description
<span class='line'>1912</span>      * @example
<span class='line'>1913</span>      * var asn1ObjOID = OID.name2obj('SHA1withRSA');
<span class='line'>1914</span>      */</span><span class="WHIT">
<span class='line'>1915</span> </span><span class="WHIT">    </span><span class="NAME">this.name2obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1916</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1917</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1918</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.name2oidList</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1919</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"Name of ObjectIdentifier not defined: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1920</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.name2oidList</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1921</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERObjectIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'oid'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1922</span> </span><span class="WHIT">        </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1923</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1924</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1925</span> 
<span class='line'>1926</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1927</span>      * get DERObjectIdentifier by registered attribyte type name such like 'C' or 'CN'
<span class='line'>1928</span>      * @name atype2obj
<span class='line'>1929</span>      * @memberOf KJUR.asn1.x509.OID
<span class='line'>1930</span>      * @function
<span class='line'>1931</span>      * @param {String} atype short attribute type name such like 'C' or 'CN'
<span class='line'>1932</span>      * @description
<span class='line'>1933</span>      * @example
<span class='line'>1934</span>      * var asn1ObjOID = OID.atype2obj('CN');
<span class='line'>1935</span>      */</span><span class="WHIT">
<span class='line'>1936</span> </span><span class="WHIT">    </span><span class="NAME">this.atype2obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">atype</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1937</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">atype</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1938</span> </span><span class="WHIT">            </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">atype</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1939</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.atype2oidList</span><span class="PUNC">[</span><span class="NAME">atype</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1940</span> </span><span class="WHIT">            </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"AttributeType name undefined: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">atype</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1941</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.atype2oidList</span><span class="PUNC">[</span><span class="NAME">atype</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1942</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERObjectIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'oid'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1943</span> </span><span class="WHIT">        </span><span class="NAME">this.objCache</span><span class="PUNC">[</span><span class="NAME">atype</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1944</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1945</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1946</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1947</span> 
<span class='line'>1948</span> </span><span class="COMM">/*
<span class='line'>1949</span>  * convert OID to name
<span class='line'>1950</span>  * @name oid2name
<span class='line'>1951</span>  * @memberOf KJUR.asn1.x509.OID
<span class='line'>1952</span>  * @function
<span class='line'>1953</span>  * @param {String} dot noted Object Identifer string (ex. 1.2.3.4)
<span class='line'>1954</span>  * @return {String} OID name
<span class='line'>1955</span>  * @description
<span class='line'>1956</span>  * This static method converts OID string to its name.
<span class='line'>1957</span>  * If OID is undefined then it returns empty string (i.e. '').
<span class='line'>1958</span>  * @example
<span class='line'>1959</span>  * name = KJUR.asn1.x509.OID.oid2name("1.3.6.1.5.5.7.1.1");
<span class='line'>1960</span>  * // name will be 'authorityInfoAccess'.
<span class='line'>1961</span>  * @since asn1x509 1.0.9
<span class='line'>1962</span>  */</span><span class="WHIT">
<span class='line'>1963</span> </span><span class="NAME">KJUR.asn1.x509.OID.oid2name</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oid</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1964</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">list</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.name2oidList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1965</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">list</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1966</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">list</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1967</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1968</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1969</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1970</span> 
<span class='line'>1971</span> </span><span class="COMM">/*
<span class='line'>1972</span>  * convert name to OID
<span class='line'>1973</span>  * @name name2oid
<span class='line'>1974</span>  * @memberOf KJUR.asn1.x509.OID
<span class='line'>1975</span>  * @function
<span class='line'>1976</span>  * @param {String} OID name
<span class='line'>1977</span>  * @return {String} dot noted Object Identifer string (ex. 1.2.3.4)
<span class='line'>1978</span>  * @description
<span class='line'>1979</span>  * This static method converts from OID name to OID string.
<span class='line'>1980</span>  * If OID is undefined then it returns empty string (i.e. '').
<span class='line'>1981</span>  * @example
<span class='line'>1982</span>  * name = KJUR.asn1.x509.OID.name2oid("authorityInfoAccess");
<span class='line'>1983</span>  * // name will be '1.3.6.1.5.5.7.1.1'.
<span class='line'>1984</span>  * @since asn1x509 1.0.11
<span class='line'>1985</span>  */</span><span class="WHIT">
<span class='line'>1986</span> </span><span class="NAME">KJUR.asn1.x509.OID.name2oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1987</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">list</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.name2oidList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1988</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">list</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1989</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">list</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1990</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1991</span> 
<span class='line'>1992</span> </span><span class="COMM">/**
<span class='line'>1993</span>  * X.509 certificate and CRL utilities class
<span class='line'>1994</span>  * @name KJUR.asn1.x509.X509Util
<span class='line'>1995</span>  * @class X.509 certificate and CRL utilities class
<span class='line'>1996</span>  */</span><span class="WHIT">
<span class='line'>1997</span> </span><span class="NAME">KJUR.asn1.x509.X509Util</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1998</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>1999</span>      * get PKCS#8 PEM public key string from RSAKey object
<span class='line'>2000</span>      * @name getPKCS8PubKeyPEMfromRSAKey
<span class='line'>2001</span>      * @memberOf KJUR.asn1.x509.X509Util
<span class='line'>2002</span>      * @function
<span class='line'>2003</span>      * @param {RSAKey} rsaKey RSA public key of {@link RSAKey} object
<span class='line'>2004</span>      * @description
<span class='line'>2005</span>      * @example
<span class='line'>2006</span>      * var pem = KJUR.asn1.x509.X509Util.getPKCS8PubKeyPEMfromRSAKey(pubKey);
<span class='line'>2007</span>      */</span><span class="WHIT">
<span class='line'>2008</span> </span><span class="WHIT">    </span><span class="NAME">this.getPKCS8PubKeyPEMfromRSAKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">rsaKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2009</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2010</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex</span><span class="PUNC">(</span><span class="NAME">rsaKey.n</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2011</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.integerToByteHex</span><span class="PUNC">(</span><span class="NAME">rsaKey.e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2012</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hN</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2013</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERInteger</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hE</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2014</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">asn1PubKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">iN</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iE</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2015</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hPubKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">asn1PubKey.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2016</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'rsaEncryption'</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2017</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERBitString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'00'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hPubKey</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2018</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">o1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">o2</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2019</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hP8</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2020</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pem</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.getPEMStringFromHex</span><span class="PUNC">(</span><span class="NAME">hP8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"PUBLIC KEY"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2021</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">pem</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2022</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2023</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2024</span> </span><span class="COMM">/**
<span class='line'>2025</span>  * issue a certificate in PEM format
<span class='line'>2026</span>  * @name newCertPEM
<span class='line'>2027</span>  * @memberOf KJUR.asn1.x509.X509Util
<span class='line'>2028</span>  * @function
<span class='line'>2029</span>  * @param {Array} param parameter to issue a certificate
<span class='line'>2030</span>  * @since asn1x509 1.0.6
<span class='line'>2031</span>  * @description
<span class='line'>2032</span>  * This method can issue a certificate by a simple
<span class='line'>2033</span>  * JSON object.
<span class='line'>2034</span>  * Signature value will be provided by signing with 
<span class='line'>2035</span>  * private key using 'cakey' parameter or 
<span class='line'>2036</span>  * hexa decimal signature value by 'sighex' parameter.
<span class='line'>2037</span>  *
<span class='line'>2038</span>  * NOTE: When using DSA or ECDSA CA signing key,
<span class='line'>2039</span>  * use 'paramempty' in 'sigalg' to ommit parameter field
<span class='line'>2040</span>  * of AlgorithmIdentifer. In case of RSA, parameter
<span class='line'>2041</span>  * NULL will be specified by default.
<span class='line'>2042</span>  *
<span class='line'>2043</span>  * @example
<span class='line'>2044</span>  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM(
<span class='line'>2045</span>  * { serial: {int: 4},
<span class='line'>2046</span>  *   sigalg: {name: 'SHA1withECDSA', paramempty: true},
<span class='line'>2047</span>  *   issuer: {str: '/C=US/O=a'},
<span class='line'>2048</span>  *   notbefore: {'str': '130504235959Z'},
<span class='line'>2049</span>  *   notafter: {'str': '140504235959Z'},
<span class='line'>2050</span>  *   subject: {str: '/C=US/O=b'},
<span class='line'>2051</span>  *   sbjpubkey: pubKeyPEM,
<span class='line'>2052</span>  *   ext: [
<span class='line'>2053</span>  *     {basicConstraints: {cA: true, critical: true}},
<span class='line'>2054</span>  *     {keyUsage: {bin: '11'}},
<span class='line'>2055</span>  *   ],
<span class='line'>2056</span>  *   cakey: [prvkey, pass]}
<span class='line'>2057</span>  * );
<span class='line'>2058</span>  * // -- or --
<span class='line'>2059</span>  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM(
<span class='line'>2060</span>  * { serial: {int: 1},
<span class='line'>2061</span>  *   sigalg: {name: 'SHA1withRSA', paramempty: true},
<span class='line'>2062</span>  *   issuer: {str: '/C=US/O=T1'},
<span class='line'>2063</span>  *   notbefore: {'str': '130504235959Z'},
<span class='line'>2064</span>  *   notafter: {'str': '140504235959Z'},
<span class='line'>2065</span>  *   subject: {str: '/C=US/O=T1'},
<span class='line'>2066</span>  *   sbjpubkey: pubKeyObj,
<span class='line'>2067</span>  *   sighex: '0102030405..'}
<span class='line'>2068</span>  * );
<span class='line'>2069</span>  * // for the issuer and subject field, another
<span class='line'>2070</span>  * // representation is also available
<span class='line'>2071</span>  * var certPEM = KJUR.asn1.x509.X509Util.newCertPEM(
<span class='line'>2072</span>  * { serial: {int: 1},
<span class='line'>2073</span>  *   sigalg: {name: 'SHA1withRSA', paramempty: true},
<span class='line'>2074</span>  *   issuer: {C: "US", O: "T1"},
<span class='line'>2075</span>  *   notbefore: {'str': '130504235959Z'},
<span class='line'>2076</span>  *   notafter: {'str': '140504235959Z'},
<span class='line'>2077</span>  *   subject: {C: "US", O: "T1", CN: "http://example.com/"},
<span class='line'>2078</span>  *   sbjpubkey: pubKeyObj,
<span class='line'>2079</span>  *   sighex: '0102030405..'}
<span class='line'>2080</span>  * );
<span class='line'>2081</span>  */</span><span class="WHIT">
<span class='line'>2082</span> </span><span class="NAME">KJUR.asn1.x509.X509Util.newCertPEM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">param</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2083</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ns1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2084</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ns1.TBSCertificate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2085</span> 
<span class='line'>2086</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.serial</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2087</span> </span><span class="WHIT">        </span><span class="NAME">o.setSerialNumberByParam</span><span class="PUNC">(</span><span class="NAME">param.serial</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2088</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2089</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"serial number undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2090</span> 
<span class='line'>2091</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">param.sigalg.name</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2092</span> </span><span class="WHIT">        </span><span class="NAME">o.setSignatureAlgByParam</span><span class="PUNC">(</span><span class="NAME">param.sigalg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2093</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT"> 
<span class='line'>2094</span>         </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"unproper signature algorithm name"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2095</span> 
<span class='line'>2096</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.issuer</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2097</span> </span><span class="WHIT">        </span><span class="NAME">o.setIssuerByParam</span><span class="PUNC">(</span><span class="NAME">param.issuer</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2098</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2099</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"issuer name undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2100</span> </span><span class="WHIT">    
<span class='line'>2101</span>     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.notbefore</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2102</span> </span><span class="WHIT">        </span><span class="NAME">o.setNotBeforeByParam</span><span class="PUNC">(</span><span class="NAME">param.notbefore</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2103</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2104</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"notbefore undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2105</span> 
<span class='line'>2106</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.notafter</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2107</span> </span><span class="WHIT">        </span><span class="NAME">o.setNotAfterByParam</span><span class="PUNC">(</span><span class="NAME">param.notafter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2108</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2109</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"notafter undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2110</span> 
<span class='line'>2111</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.subject</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2112</span> </span><span class="WHIT">        </span><span class="NAME">o.setSubjectByParam</span><span class="PUNC">(</span><span class="NAME">param.subject</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2113</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2114</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"subject name undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2115</span> 
<span class='line'>2116</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.sbjpubkey</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2117</span> </span><span class="WHIT">        </span><span class="NAME">o.setSubjectPublicKeyByGetKey</span><span class="PUNC">(</span><span class="NAME">param.sbjpubkey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2118</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>2119</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"subject public key undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2120</span> 
<span class='line'>2121</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.ext</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">param.ext.length</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2122</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">param.ext.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2123</span> </span><span class="WHIT">            </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">param.ext</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2124</span> </span><span class="WHIT">                </span><span class="NAME">o.appendExtensionByName</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.ext</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2125</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>2126</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>2127</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>2128</span> 
<span class='line'>2129</span> </span><span class="WHIT">    </span><span class="COMM">// set signature</span><span class="WHIT">
<span class='line'>2130</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.cakey</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">param.sighex</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>2131</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"param cakey and sighex undefined."</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2132</span> 
<span class='line'>2133</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2134</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2135</span> 
<span class='line'>2136</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.cakey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2137</span> </span><span class="WHIT">        </span><span class="NAME">caKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KEYUTIL.getKey.apply</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">param.cakey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2138</span> </span><span class="WHIT">        </span><span class="NAME">cert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ns1.Certificate</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'tbscertobj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'prvkeyobj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">caKey</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2139</span> </span><span class="WHIT">        </span><span class="NAME">cert.sign</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2140</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>2141</span> 
<span class='line'>2142</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">param.sighex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>2143</span> </span><span class="WHIT">        </span><span class="NAME">cert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ns1.Certificate</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="STRN">'tbscertobj'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2144</span> </span><span class="WHIT">        </span><span class="NAME">cert.setSignatureHex</span><span class="PUNC">(</span><span class="NAME">param.sighex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2145</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>2146</span> 
<span class='line'>2147</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">cert.getPEMString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2148</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>2149</span> 
<span class='line'>2150</span> </span><span class="COMM">/*
<span class='line'>2151</span>   org.bouncycastle.asn1.x500
<span class='line'>2152</span>   AttributeTypeAndValue
<span class='line'>2153</span>   DirectoryString
<span class='line'>2154</span>   RDN
<span class='line'>2155</span>   X500Name
<span class='line'>2156</span>   X500NameBuilder
<span class='line'>2157</span> 
<span class='line'>2158</span>   org.bouncycastleasn1.x509
<span class='line'>2159</span>   TBSCertificate
<span class='line'>2160</span> */</span><span class="WHIT">
<span class='line'>2161</span> </span></pre></body></html>